public async Task <IActionResult> AddEducation(int userId, [FromBody] EducationDTO educationForAddd) { if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value)) { return(Unauthorized()); } await _repo.AddEducation(userId, educationForAddd); return(Ok()); }
public async Task AddEducation(Education model, int resumeId) { var resume = await _resumeRepository.FindResume(resumeId); model.Resume = resume; if (model.NotFinished) { model.YearTo = 0; } await _educationRepository.AddEducation(model); }
public async Task <IActionResult> AddEducation([FromBody] Education education) { var _education = await _educationRepository.AddEducation(education); if (_education == null) { return(NotFound("Educação não encontrada")); } else { return(Ok(_education)); } }