summaryrefslogtreecommitdiff
path: root/api/alerts.ts
diff options
context:
space:
mode:
authorJustZvan <justzvan@justzvan.xyz>2026-02-06 13:22:33 +0100
committerJustZvan <justzvan@justzvan.xyz>2026-02-06 13:22:33 +0100
commit7eb8ccae48b0cc18a9dcaa9c3626a02df8e6d919 (patch)
tree57b7dd06ac9aa7053c671d916f7183e3b4fa9410 /api/alerts.ts
feat: initial commit!
Diffstat (limited to 'api/alerts.ts')
-rw-r--r--api/alerts.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/api/alerts.ts b/api/alerts.ts
new file mode 100644
index 0000000..8fbcb07
--- /dev/null
+++ b/api/alerts.ts
@@ -0,0 +1,18 @@
+import { apiClient } from "./client";
+import { Alert } from "./types";
+
+export async function getAlerts(): Promise<Alert[]> {
+ try {
+ console.log("getAlerts: Making API call to /parent/alerts");
+ const response = await apiClient.get<{
+ success: boolean;
+ alerts: Alert[];
+ }>("/parent/alerts");
+
+ console.log("getAlerts: API response:", response);
+ return response.alerts;
+ } catch (e) {
+ console.error("Failed to fetch alerts", e);
+ return [];
+ }
+}