public async Task <IActionResult> DeleteReview(int id) { var response = await _reviewData.DeleteReview(id); if (!response.IsSuccessful) { return(View("Error", new ErrorViewModel(response.ErrorMessage, response.ErrorException.ToString()))); } return(RedirectToAction("MyReviews")); }
public async Task <IActionResult> DeleteReview(int id) { try { if (!await _reviewData.DeleteReview(id)) { return(NotFound()); } return(NoContent()); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }