Merge pull request #2419 from bluewave-labs/feat/edit-notification-channel

feat: implement editing notification channels
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-10 13:47:25 +08:00
commit 64390bae2b
15 files changed
+279 -32

No files matched your search

@@ -84,6 +84,30 @@ const deleteNotificationById = async (id) => {
}
};
const getNotificationById = async (id) => {
try {
const notification = await Notification.findById(id);
return notification;
} catch (error) {
error.service = SERVICE_NAME;
error.method = "getNotificationById";
throw error;
}
};
const editNotification = async (id, notificationData) => {
try {
const notification = await Notification.findByIdAndUpdate(id, notificationData, {
new: true,
});
return notification;
} catch (error) {
error.service = SERVICE_NAME;
error.method = "editNotification";
throw error;
}
};
export {
createNotification,
getNotificationsByTeamId,
@@ -91,4 +115,6 @@ export {
getNotificationsByMonitorId,
deleteNotificationsByMonitorId,
deleteNotificationById,
getNotificationById,
editNotification,
};