Skip to content

Commit

Permalink
Fix $set and $addToSet conflict on _flavourRecords (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
BcGovNeal authored Jul 14, 2021
1 parent 3167a87 commit d72dc57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/utils/put-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ exports.editRecordWithFlavours = async function (args, res, next, incomingObj, e
}
}

// Remove _flavourRecords from updateObject. New flavours are added through flavourIds.
// This is to prevent update object having _flavourRecords in both $set and $addToSet
delete incomingObj._flavourRecords;

const MasterModel = mongoose.model(masterSchemaName);
const updateMasterObj = editMaster(args, res, next, incomingObj, flavourIds);

Expand Down

0 comments on commit d72dc57

Please sign in to comment.