refactor: rewrite useConfig with RQ

This commit is contained in:
kasia.oczkowska
2024-03-21 13:57:34 +00:00
parent 754c3269ec
commit 3a57349d8a
15 changed files with 76 additions and 254 deletions

View File

@@ -0,0 +1,16 @@
import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useAutomatischConfig() {
const query = useQuery({
queryKey: ['automatisch', 'config'],
queryFn: async ({ signal }) => {
const { data } = await api.get(`/v1/automatisch/config`, {
signal,
});
return data;
},
});
return query;
}