feat: Adding notifications endpoint

This commit is contained in:
Josepablo C
2024-08-09 21:16:24 -06:00
parent 288fdc10a7
commit 9b24704f76
9 changed files with 137 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
const { getModel } = require( '../../../lib/Models' );
const { getPagination } = require( '../../../lib/Misc' );
const { GenericHandler } = require( '../../../lib/Handlers/Generic.handler' );
const { onPatchEvent } = require('../../../lib/Handlers/Proposals.handler');
const { onPostEvent, onPatchEvent } = require('../../../lib/Handlers/Proposals.handler');
const Model = getModel('proposals');
const populate_list = [
@@ -118,6 +118,8 @@ const postProposal = async(req, res) => {
}
const proposal = new Model( data );
await proposal.save();
await onPostEvent(proposal.id, data);
return res.send( proposal );
}catch(error){
console.error( error );