From 2b45d4fd01c211c807961ea27881cce1b0428437 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Fri, 23 Nov 2018 14:23:49 -0600 Subject: [PATCH] Fix regression where non-federated P2P campaigns couldn't be created --- client/js/campaigns/new/peer_to_peer_wizard.js | 7 +++++-- client/js/campaigns/peer_to_peer/page.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/js/campaigns/new/peer_to_peer_wizard.js b/client/js/campaigns/new/peer_to_peer_wizard.js index 5070c5c2..c839d09c 100644 --- a/client/js/campaigns/new/peer_to_peer_wizard.js +++ b/client/js/campaigns/new/peer_to_peer_wizard.js @@ -1,3 +1,6 @@ +// License: LGPL-3.0-or-later + +//This is used for federated p2p campaigns require('../../components/wizard') var format_err = require('../../common/format_response_error') @@ -13,7 +16,7 @@ appl.def('create_p2p_campaign', function(el) { form_data = utils.mergeFormData(form_data, appl.new_p2p_campaign) appl.def('new_p2p_campaign_wiz.loading', true) - post_campaign(form_data) + post_p2p_campaign(form_data) .then(function(req) { appl.notify("Redirecting to your campaign...") appl.redirect(JSON.parse(req.response).url) @@ -25,7 +28,7 @@ appl.def('create_p2p_campaign', function(el) { }) // Using the bare-bones XMLHttpRequest API so we can post form data and upload the image -function post_campaign(form_data) { +function post_p2p_campaign(form_data) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest() req.open("POST", '/nonprofits/' + app.nonprofit_id + '/campaigns') diff --git a/client/js/campaigns/peer_to_peer/page.js b/client/js/campaigns/peer_to_peer/page.js index 30c134a0..5eb8c01c 100644 --- a/client/js/campaigns/peer_to_peer/page.js +++ b/client/js/campaigns/peer_to_peer/page.js @@ -1,5 +1,6 @@ // License: LGPL-3.0-or-later require('../new/peer_to_peer_wizard') +require('../new/wizard.js') require('../../common/image_uploader') var request = require("../../common/client")