Ejemplo n.º 1
0
        public async Task <IActionResult> GetOffersCart(int userId)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            List <UserOffer> userOffers = await _repo.GetUserOffersCart(userId);

            List <OfferForCartDto> offerForCartDtos;

            offerForCartDtos = Utils.GetOfferCartDtoList(userOffers, _mapper);

            return(Ok(offerForCartDtos));
        }