This commit is contained in:
Eric Gullickson
2025-11-01 21:27:42 -05:00
parent 20953c6dee
commit 046c66fc7d
203 changed files with 5699 additions and 404943 deletions

View File

@@ -11,7 +11,6 @@ import {
StationParams
} from '../domain/stations.types';
import { StationsController } from './stations.controller';
import { tenantMiddleware } from '../../../core/middleware/tenant';
export const stationsRoutes: FastifyPluginAsync = async (
fastify: FastifyInstance,
@@ -21,25 +20,25 @@ export const stationsRoutes: FastifyPluginAsync = async (
// POST /api/stations/search - Search nearby stations
fastify.post<{ Body: StationSearchBody }>('/stations/search', {
preHandler: [fastify.authenticate, tenantMiddleware],
preHandler: [fastify.authenticate],
handler: stationsController.searchStations.bind(stationsController)
});
// POST /api/stations/save - Save a station to user's favorites
fastify.post<{ Body: SaveStationBody }>('/stations/save', {
preHandler: [fastify.authenticate, tenantMiddleware],
preHandler: [fastify.authenticate],
handler: stationsController.saveStation.bind(stationsController)
});
// GET /api/stations/saved - Get user's saved stations
fastify.get('/stations/saved', {
preHandler: [fastify.authenticate, tenantMiddleware],
preHandler: [fastify.authenticate],
handler: stationsController.getSavedStations.bind(stationsController)
});
// DELETE /api/stations/saved/:placeId - Remove saved station
fastify.delete<{ Params: StationParams }>('/stations/saved/:placeId', {
preHandler: [fastify.authenticate, tenantMiddleware],
preHandler: [fastify.authenticate],
handler: stationsController.removeSavedStation.bind(stationsController)
});
};