fix(proposal events): Add userId to update accepted_by and reorder event to update all objects in time

This commit is contained in:
Josepablo C
2025-04-08 22:41:19 -06:00
parent d01859db70
commit 97b0b2ff88
3 changed files with 25 additions and 20 deletions

View File

@@ -120,7 +120,7 @@ const patchProposal = async(req, res) => {
throw "proposal data not sent";
}
await Model.findByIdAndUpdate( elementId , data );
await onPatchEvent( elementId , data );
await onPatchEvent( req.context.userId, elementId, data );
return res.send( await Model.findById( elementId ) );
}catch(error){
console.error( error );
@@ -137,7 +137,7 @@ const postProposal = async(req, res) => {
const proposal = new Model( data );
await proposal.save();
await onPostEvent(proposal.id, data);
await onPostEvent( req.context.userId, proposal.id, data);
return res.send( proposal );
}catch(error){
console.error( error );