правки по ревью

This commit is contained in:
Olga Nemt 2023-07-13 12:45:41 +05:00
parent 5f0343cf48
commit e52b6cf122
2 changed files with 9 additions and 2 deletions

View File

@ -62,6 +62,9 @@ namespace AsbCloudApp.Data.User
/// <summary>
/// Id состояния пользователя
/// 0 - не активен,
/// 1 - активен,
/// 2 - заблокирован
/// </summary>
public short IdState { get; set; }

View File

@ -117,9 +117,13 @@ namespace AsbCloudWebApi
var userService = services.BuildServiceProvider().GetRequiredService<IUserRepository>();
var user = userService.GetOrDefault(idUser.Value);
if (user is null || user.IdState != User.ActiveStateId)
if (user is null)
{
context.Fail("invaild user data");
context.Fail("user is null");
}
else if (user.IdState != User.ActiveStateId)
{
context.Fail("user is not active");
}
return Task.CompletedTask;