If testing mode is enabled and action gets deleted, inform all connected installations
This commit is contained in:
parent
00bec7d6bc
commit
615dc7bb92
|
@ -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-----------------");
|
||||||
|
|
Loading…
Reference in New Issue