Skip to content

Commit

Permalink
[Status Page] Fix monitors are deleted unexpectedly #1399
Browse files Browse the repository at this point in the history
  • Loading branch information
louislam committed Mar 21, 2022
1 parent 4545eec commit ad2130b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/socket-handlers/status-page-socket-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ module.exports.statusPageSocketHandler = (socket) => {
// Delete groups that not in the list
debug("Delete groups that not in the list");
const slots = groupIDList.map(() => "?").join(",");
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots})`, groupIDList);

const data = [
...groupIDList,
statusPage.id
];
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data);

// Also change entry page to new slug if it is the default one, and slug is changed.
if (server.entryPage === "statusPage-" + slug && statusPage.slug !== slug) {
Expand Down

0 comments on commit ad2130b

Please sign in to comment.