thainv-dev: Fix

This commit is contained in:
nguyen van thai
2024-07-17 10:35:35 +07:00
parent 5f9525371d
commit 795cd47e41
18 changed files with 78 additions and 43 deletions
+7 -2
View File
@@ -83,9 +83,14 @@ import type { Category, CategoryTree } from "~/server/models/category";
export const useCategoryStore = defineStore('usecategorystore', () => {
const categoryTree = shallowRef<CategoryTree[]>([])
const currentCategoryTree = shallowRef<any[]>([])
const url : any = useRequestURL();
const host = url.hostname.split('.')[0];
async function fetchBySiteId() {
const { data }: any = await useFetch(`/api/services/category-tree`)
const { data }: any = await useFetch(`/api/services/category-tree`,{
query: {
site: host
}
})
categoryTree.value = data.value.items
return categoryTree.value
}