- add notifications API client - add notifications modal in chat page header - show recent notification events with timestamps and count badge
15 lines
362 B
TypeScript
15 lines
362 B
TypeScript
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;
|
|
}
|