Ejemplo n.º 1
0
        public async Task <ActionResult> Delete(int id)
        {
            try
            {
                await _shopCart.DeleteCartItemAsync(id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
        public async Task <IActionResult> DeleteCartItemAsync([FromBody] int[] itemsIds)
        {
            if (itemsIds != null)
            {
                await _shopCartService.DeleteCartItemAsync(itemsIds);

                return(Ok());
            }
            else
            {
                return(BadRequest("items is not checked"));
            }
        }