Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
post(reqInfo: RequestInfo) {
const collectionName = reqInfo.collectionName;
if (collectionName === 'notifications' || collectionName === 'subscription') {
reqInfo.collection[0].push((reqInfo.req as any).body);
reqInfo.collection[1] = reqInfo.collection[1] + 1;
const options: ResponseOptions = {
status: STATUS.CREATED,
};
return reqInfo.utils.createResponse$(() => {
return this.finishOptions(options, reqInfo);
});
} else {
return undefined; // let the default POST handle all others
}
}