Пример #1
0
        public async Task <IActionResult> AddItemToBasket(AddToBasketModel model)
        {
            try
            {
                await _basketManager.AddItemToBasket(model.SKU);

                return(Ok());
            }
            catch (ProductNotFoundException ex)
            {
                _logger.LogInformation(ex, "Error occured added item to basket");
                return(BadRequest("Product code not found"));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error occured added item to basket");
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }