mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
working
This commit is contained in:
16
server/api/icons/search.get.ts
Normal file
16
server/api/icons/search.get.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const collections = ['ph', 'heroicons']
|
||||
const { query } = getQuery(event)
|
||||
|
||||
const response = await $fetch('https://api.iconify.design/search', {
|
||||
params: {
|
||||
query,
|
||||
prefixes: collections.join(','),
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
total: response.total,
|
||||
icons: response.icons && response.icons.length > 0 ? response.icons.slice(0, 25) : response.icons,
|
||||
}
|
||||
})
|
||||
@@ -11,7 +11,7 @@ export default defineEventHandler(async (event) => {
|
||||
name: body.name,
|
||||
icon: body.icon,
|
||||
color: body.color,
|
||||
nameVisible: body.nameVisible,
|
||||
primary: body.primary,
|
||||
link: body.link,
|
||||
})
|
||||
.where(
|
||||
|
||||
Reference in New Issue
Block a user