using System.Net.Http.Headers; using Blazored.LocalStorage; using FaKrosnoEfDataModel.Dtos; using Microsoft.AspNetCore.Components.Authorization; namespace OrdersManagement.Services; public class ScheduleOrderService( IHttpClientFactory httpClientFactory, CustomAuthenticationStateProvider authenticationStateProvider) : ServiceBase(httpClientFactory, authenticationStateProvider) { public async Task?> GetScheduleOrdersAsync() { try { return await GetListAsync("api/ScheduleOrders"); } catch (HttpRequestException ex) { Console.WriteLine($"Błąd HTTP w GetScheduleOrdersAsync: {ex.Message}"); return null; } } public async Task GetScheduleOrderAsync(int scheduleOrderId) { try { return await GetEntityAsync($"api/ScheduleOrders/{scheduleOrderId}"); } catch (HttpRequestException ex) { Console.WriteLine($"Błąd HTTP w GetScheduleOrderAsync: {ex.Message}"); return null; } } }