public async Task <IActionResult> UpdateOrderItem(Guid orderId, Guid productId, int productQuantity) { var command = new UpdateOrderItemCommand(CustomerId, orderId, productId, productQuantity); await _mediatrHandler.SendCommand(command); if (IsOperationValid()) { return(RedirectToAction("Index")); } var shoppingCart = await _orderQueries.GetCustomerShoppingCart(CustomerId); return(View("Index", shoppingCart)); }
public async Task <IActionResult> UpdateItem(Guid id, int quantity) { var product = await _productAppService.GetById(id); if (product == null) { return(BadRequest()); } var command = new UpdateOrderItemCommand(ClientId, id, quantity); await _mediatrHandler.SendCommand(command); if (ValidOperation()) { return(RedirectToAction("Index")); } return(View("Index", await _orderQueries.GetCartByClient(ClientId))); }
public Task <bool> Handle(UpdateOrderItemCommand request, CancellationToken cancellationToken) { throw new System.NotImplementedException(); }