push notification
fix implemented
This commit is contained in:
1 parent
0bbf2ab56f
commit
57864e00da
15 files changed
+5126
-26
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import * as api from '../lib/api';
|
||||
|
||||
export function usePushStats() {
|
||||
return useQuery({
|
||||
queryKey: ['push', 'stats'],
|
||||
queryFn: api.fetchPushStats,
|
||||
});
|
||||
}
|
||||
|
||||
export function useSendPushNotification() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: api.sendPushNotification,
|
||||
onSuccess: () => {
|
||||
void queryClient.invalidateQueries({ queryKey: ['push', 'stats'] });
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user