Update order system with new gRPC services and wallet integration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using System.Linq;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
|
||||
@@ -14,14 +15,28 @@ public partial class Cart : ComponentBase, IDisposable
|
||||
CartService.OnChange += StateHasChanged;
|
||||
}
|
||||
|
||||
private async Task IncrementQty(long productId)
|
||||
{
|
||||
var item = CartData.Items.FirstOrDefault(i => i.ProductId == productId);
|
||||
if (item is null) return;
|
||||
await CartService.UpdateQuantity(productId, item.Quantity + 1);
|
||||
}
|
||||
|
||||
private async Task DecrementQty(long productId)
|
||||
{
|
||||
var item = CartData.Items.FirstOrDefault(i => i.ProductId == productId);
|
||||
if (item is null) return;
|
||||
await CartService.UpdateQuantity(productId, item.Quantity - 1);
|
||||
}
|
||||
|
||||
private async Task ChangeQty(long productId, int value)
|
||||
{
|
||||
await CartService.UpdateQuantity(productId, value);
|
||||
}
|
||||
|
||||
private async Task Remove(long productId)
|
||||
private async Task Remove(long cartId)
|
||||
{
|
||||
await CartService.Remove(productId);
|
||||
await CartService.Remove(cartId);
|
||||
}
|
||||
|
||||
private void ProceedCheckout()
|
||||
@@ -29,7 +44,7 @@ public partial class Cart : ComponentBase, IDisposable
|
||||
Navigation.NavigateTo(RouteConstants.Store.CheckoutSummary);
|
||||
}
|
||||
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} ", price);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user