public async Task <IActionResult> UpdateUser([FromBody] UpdateUserRequestModel model) { var user = await _userService.UpdateUserAsync(model); if (user == null) { return(BadRequest(new { message = "Kullanici güncellenirken hata oluştu!" })); } var resModel = new ByNameResponseModel() { UserName = user.UserName }; return(Ok(resModel)); }
public async Task <IActionResult> DeleteUser([FromBody] ByIdRequestModel model) { if (model.Id == 0) { return(BadRequest(new { message = "Geçersiz id!" })); } var user = await _userService.DeleteUserAsync(model); if (user == null) { return(BadRequest(new { message = "Kullanici silinirken hata oluştu!" })); } var resModel = new ByNameResponseModel() { UserName = user.UserName }; return(Ok(resModel)); }