예제 #1
0
        public async Task <IActionResult> GetPayrollByEmployeeId()
        {
            try
            {
                var user = await _userManager.FindByEmailFromClaimsPrinciple(HttpContext.User);

                var payroll = await _payrollService.GetPayrollByUserProfileId(user.Id);

                var payrollMapped = _mapper.Map <IReadOnlyList <GetPayrollOutputDto> >(payroll);
                return(Ok(payrollMapped));
            }
            catch
            {
                return(BadRequest(new ApiResponse(400, "Something went wrong.")));
            }
        }