summary refs log tree commit diff
path: root/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-06-02 19:38:34 +0200
committerRory& <root@rory.gay>2025-06-02 19:38:34 +0200
commit197f7d362be4a947b1951ed560223527f8c16449 (patch)
tree307bac64e2d580b6e8cd31221e00b680e2fbefc3 /testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs
parentFix alarm bug, fix error middleware (diff)
downloadnodejs-final-assignment-197f7d362be4a947b1951ed560223527f8c16449.tar.xz
More alarm testing
Diffstat (limited to 'testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs')
-rw-r--r--testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs b/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs

index 444e313..c6f16f2 100644 --- a/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs +++ b/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs
@@ -29,7 +29,7 @@ public class SafeNSoundClient(SafeNSoundConfiguration config, string accessToken return (await res.Content.ReadFromJsonAsync<AlarmDto>())!; } - public async Task SetAlarm(AlarmDto alarm) { + public async Task SetAlarm(AlarmDto alarm, string userId = "@me") { var res = await HttpClient.PutAsJsonAsync("/alarm/@me", alarm); res.EnsureSuccessStatusCode(); } @@ -48,6 +48,12 @@ public class SafeNSoundClient(SafeNSoundConfiguration config, string accessToken #endregion + + public async Task<Dictionary<string, AlarmDto>> GetAllAlarms() { + var res = await HttpClient.GetAsync("/alarms"); + res.EnsureSuccessStatusCode(); + return (await res.Content.ReadFromJsonAsync<Dictionary<string, AlarmDto>>())!; + } }