From 879aafa3fa6ac33b6ce474dc771eefab4c13b1be Mon Sep 17 00:00:00 2001 From: zhenyi <434836402@qq.com> Date: Sun, 31 May 2026 13:11:51 +0800 Subject: [PATCH] fix(socket): add missing article events and notification types --- src/page/me/notifications.tsx | 14 +++++++++++--- src/socket/schema.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) 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) => (