* Added managing EdiCustomerOrderTranslations

This commit is contained in:
2025-04-12 07:12:14 +02:00
parent 6977708099
commit 7660db1c0b
9 changed files with 185 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
using SytelineSaAppEfDataModel.Dtos;
namespace OrdersManagement.Services;
public class EdiCustomerOrderTranslateService(
IHttpClientFactory httpClientFactory,
CustomAuthenticationStateProvider authenticationStateProvider)
: ServiceBase<EdiCustomerOrderTranslateDto>(httpClientFactory, authenticationStateProvider)
{
public async Task<IEnumerable<EdiCustomerOrderTranslateDto>?> GetEdiCustomerOrdersTranslationsAsync()
{
try
{
return await GetListAsync("api/EdiCustomerOrdersTranslations");
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Błąd HTTP w GetEdiCustomerOrdersTranslationsAsync: {ex.Message}");
return null;
}
}
public async Task<int> DeleteEdiCustomerOrderTranslateAsync(EdiCustomerOrderTranslateDto ediCustomerOrderTranslateDto)
{
HttpResponseMessage responseMessage =
await DeleteAsync($"api/EdiCustomerOrdersTranslations/?id={ediCustomerOrderTranslateDto.Id}");
return responseMessage.IsSuccessStatusCode ? 1 : 0;
}
}