Skip to content

Commit

Permalink
fix(members): adding campaign_id on registering
Browse files Browse the repository at this point in the history
  • Loading branch information
serge1peshcoff committed May 2, 2020
1 parent 97043b7 commit 8a374fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion middlewares/campaigns.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ exports.registerUser = async (req, res) => {
user = await User.scope('noExtraFields').create({
...req.body,
campaign_id: campaign.id
}, { fields: constants.FIELDS_TO_UPDATE.USER.CREATE, transaction: t });
}, {
fields: [
...constants.FIELDS_TO_UPDATE.USER.CREATE,
'campaign_id'
],
transaction: t
});

// Adding a person to a body if campaign has the autojoin body.
if (campaign.autojoin_body_id) {
Expand Down

0 comments on commit 8a374fa

Please sign in to comment.