* Added EmailAddresses and WzNumbers to WzHeader
* Changed approach to send email to addresses added to WzHeader
This commit is contained in:
@@ -6,6 +6,13 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
private readonly HttpClient _httpClient = httpClientFactory.CreateClient("FaKrosnoApi");
|
||||
|
||||
public async Task<WzHeaderDto> GetWzHeaderByIdAsync(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzHeader/by-id?id={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<WzHeaderDto>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzClientDto>> GetAllClientsAsync()
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzClient");
|
||||
@@ -98,4 +105,13 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
throw new Exception("Failed to generate XLS for Mayle");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AddEmailsToWzHeaderAsync(Guid wzHeaderId, string emailAddresses)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync(
|
||||
$"api/WzHeader/add-emails?id={wzHeaderId}",
|
||||
emailAddresses);
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user