Esempio n. 1
0
        public IActionResult DeleteReview(int reviewID)
        {
            Review deletedMessage = reviewRepo.DeleteReview(reviewID);

            if (deletedMessage != null)
            {
                TempData["review"] = $"{deletedMessage.ReviewID} was deleted";
            }
            return(RedirectToAction("AdminPage", "Admin"));
        }
        public async Task <IActionResult> DeleteReview(long reviewId)
        {
            var result = await _reviewRepository.DeleteReview(reviewId);

            return(result
          ? StatusCode(200, new BasicResponse {
                Status = "Success"
            })
          : StatusCode(404, new BasicResponse {
                Status = "Failure", FailureMessage = string.Format("Review with id {0} does not exist", reviewId)
            }));
        }