ca-grow-ops-manager/backend/src/routes/batches.routes.ts
fullsizemalt e7be23cce4
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
feat: add batch detail endpoint and fix drill-down navigation
Backend:
- Add getBatchById controller with touch points and IPM schedule
- Add GET /batches/:id route

Frontend:
- Update Batch interface to include touchPoints
- BatchDetailPage now uses real touch points from API
- Better error handling on batch load failure
2025-12-12 19:04:16 -08:00

17 lines
526 B
TypeScript

import { FastifyInstance } from 'fastify';
import { getBatches, getBatchById, createBatch, updateBatch } from '../controllers/batches.controller';
export async function batchRoutes(server: FastifyInstance) {
server.addHook('onRequest', async (request) => {
try {
await request.jwtVerify();
} catch (err) {
throw err;
}
});
server.get('/', getBatches);
server.get('/:id', getBatchById);
server.post('/', createBatch);
server.put('/:id', updateBatch);
}