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

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