category order

This commit is contained in:
efrilm
2025-10-07 00:01:53 +07:00
parent e551ae7feb
commit ac2fc4e920
10 changed files with 252 additions and 104 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ const getToken = () => {
}
export const api = axios.create({
baseURL: 'https://api-pos.apskel.id/api/v1',
// baseURL: 'http://127.0.0.1:4000/api/v1',
// baseURL: 'https://api-pos.apskel.id/api/v1',
baseURL: 'http://127.0.0.1:4000/api/v1',
headers: {
'Content-Type': 'application/json'
},
+4 -2
View File
@@ -9,7 +9,7 @@ interface CategoriesQueryParams {
}
export function useCategories(params: CategoriesQueryParams = {}) {
const { page = 1, limit = 10, search = '', ...filters } = params
const { page = 1, limit = 50, search = '', ...filters } = params
return useQuery<Categories>({
queryKey: ['categories', { page, limit, search, ...filters }],
@@ -30,7 +30,9 @@ export function useCategories(params: CategoriesQueryParams = {}) {
})
const res = await api.get(`/categories?${queryParams.toString()}`)
return res.data.data
const data = res.data.data
return data
}
})
}