refactor: rewrite useNotifications with RQ

This commit is contained in:
kasia.oczkowska
2024-03-21 09:59:51 +00:00
committed by kattoczko
parent b68aff76a1
commit d808afd21b
9 changed files with 22 additions and 52 deletions

View 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;
}