Ejemplo n.º 1
0
        //[Authorize(Policy = "IsAdminOrAgent")]
        public IActionResult GetPercentage([FromRoute] int userID, [FromRoute] int accountID)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (userID == 1)
            {
                var result = _accountsRepository.AdminProgressPercentage(accountID);
                return(Ok(result));
            }
            else
            {
                var result = _accountsRepository.GetProgressPercentage(userID, accountID);
                return(Ok(result));
            }
        }