Update order pages with error handling and improved product images

This commit is contained in:
masoodafar-web
2025-11-28 13:35:26 +03:30
parent 12d19f966c
commit 48dadf007a
11 changed files with 89 additions and 26 deletions
@@ -1,6 +1,8 @@
using System;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components;
using MudBlazor;
namespace FrontOffice.Main.Pages.Store;
@@ -14,8 +16,19 @@ public partial class Orders : ComponentBase
protected override async Task OnInitializedAsync()
{
_loading = true;
_orders = await OrderService.GetOrdersAsync();
_loading = false;
try
{
_orders = await OrderService.GetOrdersAsync();
}
catch (Exception ex)
{
Snackbar.Add($"خطا در بارگذاری سفارش‌ها: {ex.Message}", Severity.Error);
_orders = new List<GetUserOrderResponse>();
}
finally
{
_loading = false;
}
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);