public async Task <IActionResult> UpdateSubject(int id, [FromBody] SubjectEditModel subjectForUpdate) { var subject = await _quantumITAppService.UpdateSubjectAsync(id, subjectForUpdate); return(Ok(subject)); throw new Exception($"updating subject {id} failed on save!"); }
public async Task <IActionResult> UpdateSubject(int id, [FromBody] SubjectEditModel subjectForUpdate) { var subject = await _quantumITAppService.UpdateSubjectAsync(id, subjectForUpdate); if (!subject) { return(BadRequest("Subject with this name already exists!")); } return(Ok(subject)); }