This commit is contained in:
2024-08-30 18:15:07 +02:00
parent 8cadaf08a0
commit c77503ed45
17 changed files with 273 additions and 149 deletions

View 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,
}
})

View File

@@ -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(

View File

@@ -8,5 +8,5 @@ export const tables = schema
export function useDrizzle() {
const config = useRuntimeConfig()
return drizzle(postgres(config.postgres.url, { prepare: false }), { schema })
return drizzle(postgres(config.postgres.url, { prepare: false, max: 50 }), { schema })
}