Skip to content

Commit d8cea7d

Browse files
committed
Fix: only send approved status if successfully approved
1 parent b67a75e commit d8cea7d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

RZ.Server/RZ.Server/Controllers/AdminController.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ public ActionResult Approve(IFormCollection formcollection)
6666
string sApp = formcollection["ApplicationType"].ToString();
6767
if (!string.IsNullOrEmpty(sApp))
6868
{
69-
_hubContext.Clients.All.SendAsync("Append", "<li class=\"list-group-item list-group-item-warning\">%tt% - SW Approved: " + sApp + "</li>");
70-
_hubContext.Clients.All.SendAsync("Reload");
71-
Base.SendNotification("Software Approved:" + sApp, "");
72-
Base.Approve(sApp);
73-
Base.GetCatalog("", true);
7469

75-
_hubContext.Clients.All.SendAsync("Reload");
70+
bool bResult = Base.Approve(sApp);
71+
if(bResult)
72+
{
73+
_hubContext.Clients.All.SendAsync("Append", "<li class=\"list-group-item list-group-item-warning\">%tt% - SW Approved: " + sApp + "</li>");
74+
_hubContext.Clients.All.SendAsync("Reload");
75+
Base.SendNotification("Software Approved:" + sApp, "");
76+
Base.GetCatalog("", true);
77+
_hubContext.Clients.All.SendAsync("Reload");
78+
}
79+
7680
}
7781
}
7882

0 commit comments

Comments
 (0)