Ejemplo n.º 1
0
        public async Task <IActionResult> AddItemToCart(CartItemDTO item)
        {
            try
            {
                var userId = new Guid(_httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value);
                await _cartService.AddItemToCart(item, userId);

                return(Ok(200));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }