update filemanager navigation

This commit is contained in:
Kenta420 2024-02-20 15:01:43 +07:00
parent 11dc6b2132
commit 92b11f7b9d
31 changed files with 363 additions and 305 deletions

View file

@ -1,6 +1,6 @@
import customAxios from '@/lib/customAxios'
import { type RecipeDashboard } from '@/models/recipe/schema'
import { create } from 'zustand'
import useAxios from './axios'
export interface RecipeDashboardFilterQuery {
countryID: string
@ -19,8 +19,9 @@ interface RecipeDashboardHook {
const useRecipeDashboard = create<RecipeDashboardHook>(() => ({
async getRecipesDashboard(filter) {
return customAxios
.get<RecipeDashboard[]>('/v2/recipes/dashboard', {
return useAxios
.getState()
.axios.get<RecipeDashboard[]>('/v2/recipes/dashboard', {
params: filter
? {
country_id: filter.countryID,
@ -34,8 +35,9 @@ const useRecipeDashboard = create<RecipeDashboardHook>(() => ({
.catch(() => [])
},
async getMaterials(filter) {
return customAxios
.get<materialDashboard[]>('/v2/materials/dashboard', {
return useAxios
.getState()
.axios.get<materialDashboard[]>('/v2/materials/dashboard', {
params: filter
? {
country_id: filter.countryID,