implement editing notification channels

This commit is contained in:
Alex Holliday committed 2025-06-10 11:13:19 +08:00
1 parent f41709bd12
commit 0ac1f13043
13 files changed
+265 -25

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,
};