Skip to content

Commit

Permalink
[~] Fix no appzone created CactuseSecurity#2597
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidProgramming committed Nov 12, 2024
1 parent 18fa7ea commit da1e93d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,25 @@ public async Task CreateAppZones(string extAppId)
}

await DeleteExistingAppZones(owner.Id);

ModellingAppZone appZone = new();

ModellingAppZone appZone = new()
{
AppId = owner.Id,
};

ApplyNamingConvention(owner.ExtAppId.ToUpper(), appZone);

List<ModellingAppServer> appServers = await apiConnection.SendQueryAsync<List<ModellingAppServer>>(ModellingQueries.getAppServers, new { appId = owner.Id });
List<ModellingAppServerWrapper> appServerWrappers = [];

foreach (ModellingAppServer appServer in appServers)
{
appServerWrappers.Add(new ModellingAppServerWrapper() { Content = appServer });
appZone.AppServers.Add(new ModellingAppServerWrapper() { Content = appServer });
}

await AddAppZoneToDb(appZone);
int appZoneId = await AddAppZoneToDb(appZone);

appZone.Id = appZoneId;

await AddAppServerToAppZone(appZone);
}

Expand Down Expand Up @@ -83,7 +88,7 @@ private void ApplyNamingConvention(string extAppId, ModellingAppZone appZone)
appZone.Name = $"{NamingConvention.AppZone}{appZone.ManagedIdString.AppPart}";
}

private async Task<int?> AddAppZoneToDb(ModellingAppZone appZone)
private async Task<int> AddAppZoneToDb(ModellingAppZone appZone)
{
try
{
Expand Down

0 comments on commit da1e93d

Please sign in to comment.