summaryrefslogtreecommitdiff
path: root/src/lib/home
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/home')
-rw-r--r--src/lib/home/api/popularProductApi.js2
-rw-r--r--src/lib/home/hooks/useCategoryHome.js4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/home/api/popularProductApi.js b/src/lib/home/api/popularProductApi.js
index 5a6d3212..37e4390e 100644
--- a/src/lib/home/api/popularProductApi.js
+++ b/src/lib/home/api/popularProductApi.js
@@ -2,7 +2,7 @@ import axios from 'axios'
const popularProductApi = async () => {
const dataPopularProducts = await axios(
- `${process.env.SELF_HOST}/api/shop/search?q=*&page=1&orderBy=popular`
+ `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/search?q=*&page=1&orderBy=popular`
)
return dataPopularProducts.data.response
}
diff --git a/src/lib/home/hooks/useCategoryHome.js b/src/lib/home/hooks/useCategoryHome.js
index cfaa3d9c..ea9f8d6a 100644
--- a/src/lib/home/hooks/useCategoryHome.js
+++ b/src/lib/home/hooks/useCategoryHome.js
@@ -3,7 +3,9 @@ import { useQuery } from 'react-query'
const useCategoryHome = ({ id }) => {
const fetchCategoryHome = async () => await categoryHomeApi({ id })
- const { isLoading, data } = useQuery(`categoryHome-${id}`, fetchCategoryHome)
+ const { isLoading, data } = useQuery(`categoryHome-${id}`, fetchCategoryHome, {
+ refetchOnWindowFocus: false
+ })
return {
categoryHome: { data, isLoading }