Berichten: status boven bericht, ongelezen-bolletje, 'markeer als ongelezen' en dashboardtegel met aantal ongelezen (CMS-U12)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,16 @@ export function useContactMessages(filter: ContactFilter, page: number) {
|
||||
});
|
||||
}
|
||||
|
||||
/** Only the unread counter, for the dashboard tile (one item is enough: the counter is part of every list answer). */
|
||||
export function useUnreadContactCount(enabled: boolean) {
|
||||
return useQuery<number, Error>({
|
||||
queryKey: ['contact', 'messages', 'unreadCount'],
|
||||
enabled,
|
||||
queryFn: async () =>
|
||||
(await api.get<ContactMessageList>(`${BASE}?page=1&pageSize=1`)).unreadCount,
|
||||
});
|
||||
}
|
||||
|
||||
export function useContactMessage(id: string | null) {
|
||||
return useQuery<ContactMessageDetail, Error>({
|
||||
queryKey: ['contact', 'message', id],
|
||||
|
||||
Reference in New Issue
Block a user