Added fix to remove children when type changed

This commit is contained in:
Tarun Singh
2023-06-25 22:44:15 -04:00
parent 149f8c3646
commit 7a34103da6
2 changed files with 22 additions and 1 deletions

View File

@@ -1463,6 +1463,17 @@ class Monitor extends BeanModel {
return childrenIDs;
}
/**
* Unlinks all children of the the group monitor
* @param {number} groupID ID of group to remove children of
* @returns {Promise<void>}
*/
static async unlinkAllChildren(groupID) {
return await R.exec("UPDATE `monitor` SET parent = ? WHERE parent = ? ", [
null, groupID
]);
}
/**
* Checks recursive if parent (ancestors) are active
* @param {number} monitorID ID of the monitor to get