This commit is contained in:
pavelbannov 2022-10-06 11:22:10 +03:00
parent 752ce34407
commit 11ffccf983

View File

@ -197,13 +197,12 @@ public class EmployeeFullDtoHelper : EmployeeDtoHelper
await Init(result, userInfo);
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
var quotaSettings = _settingsManager.Load<TenantUserQuotaSettings>();
var userQuotaSettings = _settingsManager.LoadForUser<UserQuotaSettings>(userInfo);
if (quotaSettings.EnableUserQuota)
{
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
var userQuotaSettings = _settingsManager.LoadForUser<UserQuotaSettings>(userInfo);
result.QuotaLimit = userQuotaSettings != null ? userQuotaSettings.UserQuota : quotaSettings.DefaultUserQuota;
}