thainv-dev: Fix
This commit is contained in:
+7
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user