Files
FA_WEB/OrdersManagement/Services/ErrorLogService.cs
2025-02-28 13:33:01 +01:00

23 lines
779 B
C#

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