using Microsoft.AspNetCore.Components.Authorization; using SytelineSaAppEfDataModel.Dtos; namespace OrdersManagement.Services; public class CustomerOrderService( IHttpClientFactory httpClientFactory, AuthenticationStateProvider authenticationStateProvider) : ServiceBase(httpClientFactory, authenticationStateProvider) { public async Task?> GetCustomerOrdersAsync() { try { return await GetListAsync("api/CustomerOrders"); } catch (HttpRequestException ex) { Console.WriteLine($"Błąd HTTP w GetCustomerOrdersAsync: {ex.Message}"); return null; } } public async Task GetCustomerOrderAsync(Guid customerOrderNumber) { try { return await GetByIdAsync($"api/CustomerOrders/by-order-number/?customerOrderNumber={customerOrderNumber}"); } catch (HttpRequestException ex) { Console.WriteLine($"Błąd HTTP w GetScheduleOrderAsync: {ex.Message}"); return null; } } }