public async Task <IActionResult> UpdateUser([FromBody] UpdateUserModel model) { #region Validate Model //var userInputValidated = _updateUserModelValidator.Validate(model); //if (!userInputValidated.IsValid) // return BadRequest(new { // Succeeded = false, // Message = _badRequest.ShowError(int.Parse(userInputValidated.Errors[0].ErrorMessage)) // }); #endregion var updatedUser = await _user.UpdateUser(model); return(Ok(updatedUser)); }
public async Task <IActionResult> UpdateUser([FromBody] UpdateUserModel model) { #region Validate Model var userInputValidated = _updateUserModelValidator.Validate(model); if (!userInputValidated.IsValid) { _infos.Add(_badRequest.ShowError(int.Parse(userInputValidated.Errors[0].ErrorMessage)).Message); return(BadRequest(new CustomResponse <string> { Message = _infos })); } #endregion var updatedUser = await _user.UpdateUser(model); return(Ok(updatedUser)); }