Esempio n. 1
0
        public async Task <IActionResult> updateLoanApplication([FromBody] AdminLoanApplicationDto adminLoanApplicationDto,
                                                                CancellationToken cancellationToken = default)
        {
            string l = HttpContext.GetLoginFromClaims();

            var access = await validateUserFilter.ValidateUser(l, cancellationToken);

            if (access == "client" || access == "null")
            {
                return(Unauthorized("ERROR, Access denied"));
            }

            var success = await loanService.ConfirmLoanApplication(adminLoanApplicationDto, cancellationToken);

            if (!success)
            {
                return(UnprocessableEntity("ERROR, Loan application cannot be update"));
            }

            return(Ok());
        }