Fix: Fix tag removal, reuse and validation

This commit is contained in:
Nelson Chan 2021-09-10 14:22:34 +08:00
parent fcbeed55bf
commit a0e4e96160
2 changed files with 61 additions and 56 deletions

View file

@ -752,13 +752,14 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
}
});
socket.on("deleteMonitorTag", async (tagID, monitorID, callback) => {
socket.on("deleteMonitorTag", async (tagID, monitorID, value, callback) => {
try {
checkLogin(socket)
await R.exec("DELETE FROM monitor_tag WHERE tag_id = ? AND monitor_id = ?", [
await R.exec("DELETE FROM monitor_tag WHERE tag_id = ? AND monitor_id = ? AND value = ?", [
tagID,
monitorID,
value,
])
// Cleanup unused Tags