18 lines
429 B
TypeScript
18 lines
429 B
TypeScript
import _ from 'lodash'
|
|
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox'
|
|
import knex from '../../lib/knex.ts'
|
|
|
|
const financialYearRoutes: FastifyPluginCallbackTypebox = (fastify, _, done) => {
|
|
fastify.route({
|
|
url: '/',
|
|
method: 'GET',
|
|
handler() {
|
|
return knex('financialYear').select('*').orderBy('startDate', 'desc')
|
|
},
|
|
})
|
|
|
|
done()
|
|
}
|
|
|
|
export default financialYearRoutes
|