From b39bdd64e00f368a06a83d0fd2de80c6eb89c875 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 26 Mar 2021 02:10:59 +0300 Subject: fix: do not override custom service API --- src/hooks/useAPIClient.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts index e992b42..c7e8d31 100644 --- a/src/hooks/useAPIClient.ts +++ b/src/hooks/useAPIClient.ts @@ -9,6 +9,8 @@ const fetcher = (endpoint: string) => get(endpoint).then(response => response.da const hooks: any = {}; const registerServiceHooks = (service: string): void => { + if (hooks[service]) return; + const useList = (query = '', options = {}): Response => { return useSWR(`/${service}${query}`, fetcher, options); }; -- cgit v1.2.3