summaryrefslogtreecommitdiff
path: root/api/alerts.ts
diff options
context:
space:
mode:
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 [];
+ }
+}