Fix regression where non-federated P2P campaigns couldn't be created
This commit is contained in:
parent
0ad9181533
commit
2b45d4fd01
2 changed files with 6 additions and 2 deletions
|
@ -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')
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue