mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
14 lines
268 B
TypeScript
14 lines
268 B
TypeScript
export function useCategories() {
|
|
async function getCategories() {
|
|
return useAsyncData<CategoryType[]>(async () => {
|
|
const res = await $fetch('/api/categories')
|
|
console.log('res', res)
|
|
return res
|
|
})
|
|
}
|
|
|
|
return {
|
|
getCategories,
|
|
}
|
|
}
|