brf/server/routes/api/journals.ts
2025-12-18 07:31:39 +01:00

19 lines
399 B
TypeScript

import _ from 'lodash'
import type { FastifyPluginCallbackZod } from 'fastify-type-provider-zod'
const journalRoutes: FastifyPluginCallbackZod = (fastify, _, done) => {
const { db } = fastify
fastify.route({
url: '/',
method: 'GET',
handler() {
return db.selectFrom('journal').selectAll().orderBy('identifier').execute()
},
})
done()
}
export default journalRoutes