summaryrefslogtreecommitdiff
path: root/src/lib/home/hooks
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-02 17:15:39 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-02 17:15:39 +0700
commit55c9f5e1fb868c85e704529ac914b3d75fc7744e (patch)
tree75543baf82a73fb7e8dea6c8a1c353e02c57bbcd /src/lib/home/hooks
parentd57ca7be5e2de9c48f4229b20a49a94bf05e88d1 (diff)
parent6a2c25e83a45eeb5d613a99a0caa6f0ec1aae15f (diff)
<iman> Merge branch 'development' into Feature/new-cart-popup
Diffstat (limited to 'src/lib/home/hooks')
-rw-r--r--src/lib/home/hooks/useCategoryManagement.js13
-rw-r--r--src/lib/home/hooks/useCategoryPilihan.js13
2 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/home/hooks/useCategoryManagement.js b/src/lib/home/hooks/useCategoryManagement.js
new file mode 100644
index 00000000..c1dda585
--- /dev/null
+++ b/src/lib/home/hooks/useCategoryManagement.js
@@ -0,0 +1,13 @@
+import categoryManagementApi from '../api/categoryManagementApi'
+import { useQuery } from 'react-query'
+
+const useCategoryManagement = () => {
+ const fetchCategoryManagement = async () => await categoryManagementApi()
+ const { isLoading, data } = useQuery('categoryManagementApi', fetchCategoryManagement)
+
+ return {
+ categoryManagement: { data, isLoading }
+ }
+}
+
+export default useCategoryManagement \ No newline at end of file
diff --git a/src/lib/home/hooks/useCategoryPilihan.js b/src/lib/home/hooks/useCategoryPilihan.js
new file mode 100644
index 00000000..12a86f7e
--- /dev/null
+++ b/src/lib/home/hooks/useCategoryPilihan.js
@@ -0,0 +1,13 @@
+import categoryPilihanApi from '../api/CategoryPilihanApi'
+import { useQuery } from 'react-query'
+
+const useCategoryPilihan = () => {
+ const fetchCategoryPilihan = async () => await categoryPilihanApi()
+ const { isLoading, data } = useQuery('categoryPilihanApi', fetchCategoryPilihan)
+
+ return {
+ categoryPilihan: { data, isLoading }
+ }
+}
+
+export default useCategoryPilihan \ No newline at end of file