mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-31 11:27:49 +01:00
working
This commit is contained in:
18
app/composables/icons.ts
Normal file
18
app/composables/icons.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export function useIcons() {
|
||||
const loading = ref(false)
|
||||
async function search(query: string) {
|
||||
if (query) {
|
||||
loading.value = true
|
||||
}
|
||||
const response = await $fetch('/api/icons/search', {
|
||||
query: { query },
|
||||
})
|
||||
loading.value = false
|
||||
return response.icons
|
||||
}
|
||||
|
||||
return {
|
||||
loading,
|
||||
search,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user