public async Task <IActionResult> DeleteConfirmed(int id) { var job = await _service.GetJobById(id); await _service.DeleteJob(job.Id); return(RedirectToAction(nameof(Index))); }
public async Task <ActionResult <Job> > DeleteJob(string id) { try { var job = await _jobsService.GetJobById(id); if (job == null) { return(NotFound()); } await _jobsService.DeleteJob(id); await _jobsService.Save(); return(Ok(job)); } catch (Exception) { return(BadRequest()); } }
public IActionResult DeleteConfirmed(int id) { _jobs.DeleteJob(id); return(RedirectToAction(nameof(Index))); }