예제 #1
0
        public async Task <IActionResult> CreateEmployment([FromBody] CreateEmploymentDto createEmploymentDto)
        {
            try
            {
                await _employmentService.SetEmploymentStatus(createEmploymentDto.EmployeeId, createEmploymentDto.EmployerId,
                                                             createEmploymentDto.RelationshipShouldExist);

                return(Ok());
            }
            catch (EntityNotFoundException ex)
            {
                return(BadRequest(new ErrorResponse
                {
                    Code = ErrorCodes.CouldNotChangeEmploymentStatus,
                    Reason = ex.Message
                }));
            }
        }