diff --git a/frontend/src/hooks/api/getters/useApiGetter/useApiGetter.ts b/frontend/src/hooks/api/getters/useApiGetter/useApiGetter.ts index 5c95673430..fc044427b7 100644 --- a/frontend/src/hooks/api/getters/useApiGetter/useApiGetter.ts +++ b/frontend/src/hooks/api/getters/useApiGetter/useApiGetter.ts @@ -33,3 +33,8 @@ export const fetcher = (path: string, errorTarget: string) => { .then(handleErrorResponses(errorTarget)) .then((res) => res.json()); }; + +export const createFetcher = + ({ url, errorTarget }: { url: string; errorTarget: string }) => + () => + fetcher(url, errorTarget);