If testing mode is enabled and action gets deleted, inform all connected installations

This commit is contained in:
Noe 2024-07-23 15:00:51 +02:00
parent 00bec7d6bc
commit 615dc7bb92
1 changed files with 7 additions and 1 deletions

View File

@ -176,7 +176,13 @@ public static class SessionMethods
if (user is null || user.UserType == 0) if (user is null || user.UserType == 0)
return false; return false;
var action = Db.GetActionById(actionId); var action = Db.GetActionById(actionId);
if (action.TestingMode)
{
var installation = Db.GetInstallationById(action.InstallationId);
installation.TestingMode = false;
installation.Apply(Db.Update);
WebsocketManager.InformWebsocketsForInstallation(action.InstallationId);
}
Db.Delete(action); Db.Delete(action);
Console.WriteLine("---------------Deleted the Action in the database-----------------"); Console.WriteLine("---------------Deleted the Action in the database-----------------");