refactor: rewrite useNotifications with RQ
This commit is contained in:

committed by
kattoczko

parent
b68aff76a1
commit
d808afd21b
16
packages/web/src/hooks/useAutomatischNotifications.js
Normal file
16
packages/web/src/hooks/useAutomatischNotifications.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import api from 'helpers/api';
|
||||
|
||||
export default function useAutomatischNotifications() {
|
||||
const query = useQuery({
|
||||
queryKey: ['automatisch', 'notifications'],
|
||||
queryFn: async ({ signal }) => {
|
||||
const { data } = await api.get(`/v1/automatisch/notifications`, {
|
||||
signal,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return query;
|
||||
}
|
Reference in New Issue
Block a user