backend/src/controllers/train.controllers.js
Fred Boniface 524e9b271d Add find by headcode including PIS
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-06-01 12:40:43 +01:00

16 lines
376 B
JavaScript

const train = require('../services/trainService.services');
async function getByHeadcodeToday(req, res, next){
try {
var searchHeadcode = req.params.id;
res.json(await train.findByHeadcodeToday(searchHeadcode));
} catch (err) {
console.error('Unknown Error', err.message);
err.status = 500;
next(err);
}
}
module.exports = {
getByHeadcodeToday
};