public async Task <ActionResult <Envelope <ApplicantResponse> > > RemoveApplicant(int applicantId) { var removeApplicant = await _applicantService.RemoveApplicant(applicantId); if (removeApplicant.IsSuccess) { return(Ok(Envelope.Ok(ApplicantResponse.Map(removeApplicant.Value)))); } return(BadRequest(Envelope.Error(removeApplicant.Error))); }
public async Task <ActionResult <Envelope <ApplicantResponse> > > ModifyApplicant(int applicantId, [FromBody] ApplicantDto dto) { var modifyApplicant = await _applicantService.ModifyApplicant(applicantId, dto); if (modifyApplicant.IsSuccess) { return(Ok(Envelope.Ok(ApplicantResponse.Map(modifyApplicant.Value)))); } return(BadRequest(Envelope.Error(modifyApplicant.Error))); }
public async Task <ActionResult <Envelope <ApplicantResponse> > > RegisterApplicant([FromBody] ApplicantDto dto) { var registerApplicant = await _applicantService.RegisterApplicant(dto); if (registerApplicant.IsSuccess) { return(CreatedAtAction(nameof(GetApplicant), new { applicantId = registerApplicant.Value.Id }, Envelope.Ok(ApplicantResponse.Map(registerApplicant.Value)))); } return(BadRequest(Envelope.Error(registerApplicant.Error))); }