Occupancy script related fixes

This commit is contained in:
Justinas K. 2022-01-11 17:23:50 +02:00
parent 1790f65436
commit 617890df83
1 changed files with 13 additions and 1 deletions

View File

@ -245,6 +245,18 @@ private async Task AddRemoveOccupancyAccessLevelAsync(int tenantId, bool remove)
{
int filterId = await CreateCompanyFilterAsync(tenantId);
if (filterId <= 0)
{
await Context.LogErrorAsync("Invalid filter id");
return;
}
if (tenantId <= 0)
{
await Context.LogErrorAsync("Invalid tenant id");
return;
}
try
{
IEnumerable<MDP.SID.Scripting.Grpc.AccessLevel> als = await Context.GetAccessLevelsAsync();
@ -329,4 +341,4 @@ private async Task SyncTenantsAsync()
{
_syncLock.Release();
}
}
}