mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
14 lines
298 B
TypeScript
14 lines
298 B
TypeScript
import type { CategoryType } from '@prisma/client'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const { type } = getQuery<{ type: CategoryType }>(event)
|
|
return await usePrisma().category.findMany({
|
|
cacheStrategy: {
|
|
ttl: 60 * 3,
|
|
},
|
|
where: {
|
|
type,
|
|
},
|
|
})
|
|
})
|