* Added managing EdiCustomerOrderTranslations
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user