diff --git a/src/page/me/notifications.tsx b/src/page/me/notifications.tsx index 075eb5b..606063a 100644 --- a/src/page/me/notifications.tsx +++ b/src/page/me/notifications.tsx @@ -1,9 +1,17 @@ import { Bell, Check, ChevronRight } from "lucide-react"; import { Button } from "@/components/ui/button"; -import { client } from "@/client"; +import { api } from "@/client"; import { useQuery } from "@tanstack/react-query"; import { useAuth } from "@/context/auth-context"; +interface NotificationItem { + id: string; + title: string; + body: string; + read_at?: string | null; + created_at: string; +} + export default function MeNotificationsPage() { const { me } = useAuth(); const unreadCount = me?.has_unread_notifications ?? 0; @@ -11,7 +19,7 @@ export default function MeNotificationsPage() { const { data: notifications, isLoading } = useQuery({ queryKey: ["user", "notifications"], queryFn: async () => { - const res = await client.userListNotifications(); + const res = await api.get("/api/v1/ws/notifications"); return res.data; }, retry: false, @@ -40,7 +48,7 @@ export default function MeNotificationsPage() {
)) ) : (notifications ?? []).length > 0 ? ( - notifications!.map((notif) => ( + notifications!.map((notif: NotificationItem) => (