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

feat(loads/public-load-tracking): add missing data to load objects
This commit is contained in:
Josepablo C
2025-04-08 22:59:11 -06:00
parent 97b0b2ff88
commit 5e55b0f738
3 changed files with 56 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ const notificationsModel = getModel('notifications');
*/
async function onPostEvent( userId, proposalId ,newProposalData ){
/// When a post event happens it is assumed that a proposal is created
ProposalsEvents.onProposalCreate( userId, proposalId );
await ProposalsEvents.onProposalCreate( userId, proposalId );
}
/**
@@ -30,9 +30,9 @@ async function onPostEvent( userId, proposalId ,newProposalData ){
*/
async function onPatchEvent( userId, proposalId , newProposalData ){
if( !newProposalData.is_accepted ){
ProposalsEvents.onProposalRejected( userId, proposalId );
await ProposalsEvents.onProposalRejected( userId, proposalId );
}else{
ProposalsEvents.onProposalAccepted( userId, proposalId );
await ProposalsEvents.onProposalAccepted( userId, proposalId );
}
}