Refactor CartService to use async methods for cart operations and integrate gRPC for backend synchronization
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user