Update order pages with error handling and improved product images
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user