feat(notifications): add in-app notification center panel
- add notifications API client - add notifications modal in chat page header - show recent notification events with timestamps and count badge
This commit is contained in:
14
web/src/api/notifications.ts
Normal file
14
web/src/api/notifications.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { http } from "./http";
|
||||
|
||||
export interface NotificationItem {
|
||||
id: number;
|
||||
user_id: number;
|
||||
event_type: string;
|
||||
payload: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export async function getNotifications(limit = 30): Promise<NotificationItem[]> {
|
||||
const { data } = await http.get<NotificationItem[]>("/notifications", { params: { limit } });
|
||||
return data;
|
||||
}
|
||||
Reference in New Issue
Block a user