Add a method for deleting status pages when a monitor is deleted
This commit is contained in:
1 parent
9344ebc828
commit
82c9a7331b
1 file changed
+11
@@ -190,6 +190,16 @@ const deleteStatusPage = async (url) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const deleteStatusPagesByMonitorId = async (monitorId) => {
|
||||||
|
try {
|
||||||
|
await StatusPage.deleteMany({ monitors: { $in: [monitorId] } });
|
||||||
|
} catch (error) {
|
||||||
|
error.service = SERVICE_NAME;
|
||||||
|
error.method = "deleteStatusPageByMonitorId";
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
createStatusPage,
|
createStatusPage,
|
||||||
updateStatusPage,
|
updateStatusPage,
|
||||||
@@ -197,4 +207,5 @@ export {
|
|||||||
getStatusPage,
|
getStatusPage,
|
||||||
getStatusPageByUrl,
|
getStatusPageByUrl,
|
||||||
deleteStatusPage,
|
deleteStatusPage,
|
||||||
|
deleteStatusPagesByMonitorId,
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user