summaryrefslogtreecommitdiff
path: root/src/lib/home
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-03-02 17:02:12 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-03-02 17:02:12 +0700
commit405dc33dba63f008f45b76061a8f1be5031a1d5d (patch)
tree7d60a44153dfadd11f0ff0a81144720b961b5823 /src/lib/home
parentd336735a91133cc3f1cf6f67ba2ac29f0985fd2e (diff)
midtrans integration
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 }