diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-14 06:40:09 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-14 06:40:09 +0300 |
commit | e615ad0282fa02ce7e81a847b43dd3146f69b769 (patch) | |
tree | 0560eaea9a5eb9a360c026b37dc5f08f38299507 /src/hooks | |
parent | 610584c3ce986cdea431180f545e023cee14d5d2 (diff) | |
download | commercel-ui-e615ad0282fa02ce7e81a847b43dd3146f69b769.tar.gz |
fix: match keys everywhere
Diffstat (limited to 'src/hooks')
-rw-r--r-- | src/hooks/useAPIClient.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts index b36cfec..f2f2782 100644 --- a/src/hooks/useAPIClient.ts +++ b/src/hooks/useAPIClient.ts @@ -23,7 +23,7 @@ export const useProducts = (options = {}): Response<Product[]> => { export const useProduct = (_id: string): Response<Product> => { const { data: preloadedProducts } = useProducts({ revalidateOnMount: false }); - const result = useSWR(`/products/${_id}`, fetcher); + const result = useSWR(_id && `/products/${_id}`, fetcher); if (!result.data && result.isValidating) { // If we are waiting for the first result, check if we can maybe // get the data from already cached list for the time-being |