public async Task <IActionResult> UpdateRecipient(int recipientId) { if (ModelState.IsValid) { var userEmail = GetUserEmail(); if (userEmail == "error") { return(Unauthorized(new { message = "Unauthorized" })); } var recipientInDB = await _recipientService.GetRecipientById(recipientId, userEmail); if (recipientInDB == null) { return(NotFound(recipientId)); } recipientInDB.Status = false; //recipientUpdate.Email = userEmail; var result = await _recipientService.UpdateRecipient(recipientInDB); if (result) { return(Ok(new { message = "Thông tin người dùng này ko còn khả dụng !" })); } } return(BadRequest(new { message = ModelState.Values.First().Errors[0].ErrorMessage })); }