mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-06 01:39:38 -06:00
extrat userId and teamId from req.uesr
This commit is contained in:
@@ -102,6 +102,7 @@ class NotificationController {
|
||||
success =
|
||||
await this.notificationService.sendTestPagerDutyNotification(notification);
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
return res.error({
|
||||
msg: "Sending notification failed",
|
||||
@@ -128,7 +129,11 @@ class NotificationController {
|
||||
}
|
||||
|
||||
try {
|
||||
const notification = await this.db.createNotification(req.body);
|
||||
const body = req.body;
|
||||
const { _id, teamId } = req.user;
|
||||
body.userId = _id;
|
||||
body.teamId = teamId;
|
||||
const notification = await this.db.createNotification(body);
|
||||
return res.success({
|
||||
msg: "Notification created successfully",
|
||||
data: notification,
|
||||
|
||||
Reference in New Issue
Block a user