public async Task EvaluateUserAsync(EvaluateUserDto evaluateUserDto) { if (evaluateUserDto.IsApproved && await roleService.IsRoleExist(evaluateUserDto.Type.ToString())) { await this.roleService.AssignRoleToUser(evaluateUserDto.Email, evaluateUserDto.Type.ToString()); } if (!evaluateUserDto.IsApproved) { var user = await this.userManager.FindByEmailAsync(evaluateUserDto.Email); user.Status = UserStatus.NotApproved; await this.userManager.UpdateAsync(user); } }
public async Task EvaluateUser([FromBody] EvaluateUserDto evaluateUserDto) => await adminService.EvaluateUserAsync(evaluateUserDto);