chore: necessary updates given the changes in the alert controller
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json;
|
||||
|
||||
public class VigilCareApiClient
|
||||
{
|
||||
private static readonly JsonSerializerOptions ApiJsonOptions = new(JsonSerializerDefaults.Web);
|
||||
|
||||
private readonly HttpClient _http;
|
||||
|
||||
public VigilCareApiClient(HttpClient http)
|
||||
@@ -147,7 +150,7 @@ public class VigilCareApiClient
|
||||
var response = await _http.GetAsync($"/api/v1/encounters/{encounterId}/alerts");
|
||||
if (!response.IsSuccessStatusCode) return new();
|
||||
var envelope = await response.Content
|
||||
.ReadFromJsonAsync<ApiResponse<PagedResponse<AlertResponse>>>();
|
||||
.ReadFromJsonAsync<ApiResponse<PagedResponse<AlertResponse>>>(ApiJsonOptions);
|
||||
return envelope?.Data?.Items?.ToList() ?? new();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user