public async Task <TutorDto> UpdateCurrentTutor(TutorUpdateRequestDto tutorDto) { var user = await GetCurrentUser(); user.Tutor.Update(tutorDto.Resume); await _tutorRepository.SaveAsync(); return(Mapper.Map <TutorDto>(user.Tutor)); }
public async Task <IActionResult> UpdateTutor([FromBody] TutorUpdateRequestDto tutor) { try { await _tutorService.UpdateCurrentTutor(tutor); return(NoContent()); } catch (NotFoundException ex) { return(NotFound(ex.Message)); } catch (Exception ex) { _logger.LogCritical($"UpdateTutor() Error: {ex}"); return(StatusCode(500, "Internal Server Error")); } }