refactor(notifications): fetch from backend API instead of local generation

Rewrite store/notifications.ts to fetch via listNotifications
API and remove local generateId-based notification creation.
The store now acts as a simple cache with fetch/invalidate methods.
Header unread count reads from this API-backed cache.
This commit is contained in:
zetaloop
2026-05-01 04:21:03 +08:00
parent d76866ac3b
commit cd469d3d54
4 changed files with 84 additions and 74 deletions
+5 -1
View File
@@ -8,7 +8,11 @@ export { sendEmailVerificationCode } from "./email"
export { isFavorited, listFavorites } from "./favorites"
export { getFileById, uploadFile } from "./files"
export { getGameById, listGames } from "./games"
export { listNotifications, markNotificationAsRead } from "./notifications"
export {
listNotifications,
markAllNotificationsAsRead,
markNotificationAsRead,
} from "./notifications"
export { getOrderById, listOrders, listOrdersByConsumer } from "./orders"
export { getPlayerById, listPlayers, listPlayersByShop } from "./players"
export { createPost, getPostById, listPosts, listPostsByAuthor, togglePostLike } from "./posts"