public IActionResult DeletePhotoForCar(Photo photo) { var result = _photoManager.Delete(photo); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public JsonResult Delete(int photoId, int userId) { if (userId == CurrentUser.Id) { var success = _photoManager.Delete(photoId); return(new JsonResult { Data = new { Success = true } }); } return(new JsonResult { Data = new { Success = false } }); }
public JsonResult Delete(int?id) { if (id.HasValue && CurrentUser.IsAdministrator) { var success = _photoManager.Delete(id.Value); if (success > 0) { return(new JsonResult { Data = new { Success = true } }); } } return(new JsonResult { Data = new { Success = false } }); }