Closed sbagg closed 2 months ago
Here is some way of testing the commands I put it in the home page. Not how it will work in final
let ar = await this.ApprovalRequestModel.query({revisionIds:[1]}); let subject =
Sample Subject; let content =
Sample Question`;
const payloadSystem = {
"requests": {
approvalRequest: ar.payload.data[0],
reimbursementRequest: {},
}, //requests could be replaced with id
notificationType: 'request' //notification type
}
const payloadComments = {
"emailContent": {
subject: subject,
text: content
}, //email content
"url": "approval-request/1", //url
"requests": {
approvalRequest: ar.payload.data[0],
reimbursementRequest: {},
}, //requests could be replaced with id
notificationType: 'request' //notification type
}
this.NotificationModel.createSystemNotification(payloadSystem),
this.NotificationModel.createNotificationComments(payloadComments),
this.NotificationModel.getNotificationHistory()
_onNotificationSystems(e) {
if ( e.state !== 'loaded' ) return;
console.log("Created Notification System:", e);
}
_onNotificationComments(e) { if ( e.state !== 'loaded' ) return;
console.log("Created Notification Comments:", e);
}
_onNotificationHistory(e) { if ( e.state !== 'loaded' ) return;
console.log("Retrieved No:", e);
} `
This is an initial working notification. It is all functional just want to make sure if there is a better way of doing it. I used this data setup below as how I imagine a payload would be inserted but it probably has too much information. Let me know what changes are needed!