chore: necessary updates given the changes in the alert controller

This commit is contained in:
voltsrage
2026-06-25 00:40:47 +08:00
parent 666d683d67
commit 7bb9124230
32 changed files with 353 additions and 40 deletions
@@ -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();
}