From 7eb8ccae48b0cc18a9dcaa9c3626a02df8e6d919 Mon Sep 17 00:00:00 2001 From: JustZvan Date: Fri, 6 Feb 2026 13:22:33 +0100 Subject: feat: initial commit! --- api/alerts.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 api/alerts.ts (limited to 'api/alerts.ts') 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 { + 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 []; + } +} -- cgit v1.2.3