diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-08-20 09:14:52 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-08-20 09:14:52 +0000 |
| commit | 7388f27d1778aaa66191b44d725ce7c3e3e4ddd8 (patch) | |
| tree | 7fdef4f99f0f42e2d99a40bfd5b81f1ca5f4ef30 /src/lib/home/hooks | |
| parent | 6d302bb338e26810a7f90326b84086217f1f4ae0 (diff) | |
| parent | 5c5eef9d62efd83f52f7c37dacb94d50ff7cb915 (diff) | |
Merged in Feature/category-management (pull request #248)
Feature/category management
Diffstat (limited to 'src/lib/home/hooks')
| -rw-r--r-- | src/lib/home/hooks/useCategoryManagement.js | 13 | ||||
| -rw-r--r-- | src/lib/home/hooks/useCategoryPilihan.js | 13 |
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 |
