18 lines
423 B
TypeScript
18 lines
423 B
TypeScript
import _ from 'lodash'
|
|
import type { FastifyPluginCallbackZod } from 'fastify-type-provider-zod'
|
|
|
|
const financialYearRoutes: FastifyPluginCallbackZod = (fastify, _, done) => {
|
|
const { db } = fastify
|
|
fastify.route({
|
|
url: '/',
|
|
method: 'GET',
|
|
handler() {
|
|
return db.selectFrom('financialYear').selectAll().orderBy('startDate', 'desc').execute()
|
|
},
|
|
})
|
|
|
|
done()
|
|
}
|
|
|
|
export default financialYearRoutes
|