public async Task <IActionResult> Delete(int id) { var status = await _npRepo.DeleteAsync(StaticDetails.NationalParksApiPath, id, GetToken()); var infix = status ? "" : "Not"; return(Json(new { success = status, message = $"Delete {infix} Successful" })); }
public async Task <IActionResult> Delete(int id) { var status = await _npRepo.DeleteAsync(SD.NationalParkAPIPath, id, HttpContext.Session.GetString("JWTToken")); if (status) { return(Json(new { succes = true, message = "Delete Successfull" })); } return(Json(new { succes = false, message = "Delete Not Successfull" })); }
public async Task <IActionResult> Delete(int id) { var status = await _npRepo.DeleteAsync(SD.NationalParkAPIPath, id); if (status) { return(Json(new { success = true, message = "Delete Successful" })); } return(Json(new { success = false, message = "Delete Not Successful" })); }
public async Task <IActionResult> Delete(int id) { var status = await _npRepo.DeleteAsync(SD.NationalParkAPIPath, id, HttpContext.Session.GetString("JWToken")); if (status) { return(Json(new { success = true, message = $"National park with id = {id} is Deleted successful" })); } return(Json(new { success = false, message = "There are an error while deleting this National Park" })); }
public async Task <IActionResult> Delete(int id) { var status = await nationalParkRepository.DeleteAsync(SD.NationalParkApiPath, id); if (status) { return(Json(new { success = true, message = "Delete succesful" })); } return(Json(new { success = false, message = "Delete not succesful" })); }
public async Task <IActionResult> Delete(int id) { var deleteStatus = await _npRepository.DeleteAsync(SD.NationalParkAPIPath, id, Token); if (deleteStatus) { return(Json(new { success = true, message = "Delete successful!" })); } return(Json(new { success = false, message = "Delete failed!" })); }
public async Task <IActionResult> Delete(int id) { var status = await _repository.DeleteAsync(Globals.ApiNpUrl, id, HttpContext.Session.GetString("JWToken")); if (status) { return(Json(new { success = true, message = "Successfully deleted!" })); } return(Json(new { success = false, message = "Not deleted!" })); }
public async Task <IActionResult> Delete(int id) { if (await _nationalParkRepository.DeleteAsync(AppConstants.NationalParkApiPath, id)) { return(Json(new { success = true, message = "successfully deleted" })); } else { return(Json(new { success = false, message = "something went wrong while deleting" })); } }
public async Task <IActionResult> Delete(int id) { if (await _npRepo.DeleteAsync(id, SD.NationalParkAPIPath)) { return(Json(new { success = true, message = "its successed" })); } else { return(Json(new { success = true, message = "its successed" })); } }
public async Task <IActionResult> Delete(int Id) { var nationalParkObject = await _nationalPark.GetAsync(StaticDetails.NationalParkApiUrl, Id); var status = await _nationalPark.DeleteAsync(StaticDetails.NationalParkApiUrl, Id); if (status) { return(Json(new { success = true, Message = $"The {nationalParkObject.Name} was Deleted Successfully!" })); } return(Json(new { success = false, Message = $"Delete was not Successful!" })); }
public async Task <IActionResult> Delete(int id) { var token = HttpContext.Session.GetString("JwToken"); var succeed = await _npRepository.DeleteAsync(SD.NationalParkAPIPath, id, token); if (succeed) { return(Json(new { success = true, message = "National Park deleted successfully!" })); } else { return(Json(new { success = false, message = "Something goes wrong!" })); } }
public async Task <IActionResult> Delete(int?id) { if (id == null) { return(BadRequest()); } var status = await _npRepo.DeleteAsync(_npUrl, id.GetValueOrDefault(), HttpContext.Session.GetString("JWToken")); if (status) { return(Json(new { success = true, message = "Delete Successful" })); } return(Json(new { success = false, message = "Delete Not Successful" })); }