* Added Authorization which is not working

This commit is contained in:
2025-02-23 21:19:04 +01:00
parent 6774311433
commit 5bcf406465
29 changed files with 407 additions and 210 deletions

View File

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Components.Authorization;
using SytelineSaAppEfDataModel.Dtos;
namespace OrdersManagement.Services;
public class ErrorLogService(
IHttpClientFactory httpClientFactory,
AuthenticationStateProvider 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;
}
}
}