Refactor CartService to use async methods for cart operations and integrate gRPC for backend synchronization

This commit is contained in:
masoodafar-web
2025-11-20 20:10:17 +03:30
parent ddb47fda08
commit 30bac23114
7 changed files with 107 additions and 14 deletions
@@ -21,10 +21,10 @@ public partial class ProductDetail : ComponentBase
_loading = false;
}
private void AddToCart()
private async Task AddToCart()
{
if (_product is null) return;
Cart.Add(_product, _qty);
await Cart.Add(_product, _qty);
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);