backend/src/controllers/find.controllers.js
Fred Boniface 7c76d2aa5f Lint fixes
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-05-05 01:01:09 +01:00

58 lines
1.1 KiB
JavaScript

const find = require('../services/find.services');
async function findName(req, res, next){
try {
var id = req.params.id;
res.json(await find.name(id));
} catch (err) {
console.error('Unknown Error', err.message);
next(err);
}
}
async function findCrs(req, res, next){
try {
var id = req.params.id;
res.json(await find.crs(id));
} catch (err) {
console.error('Unknown Error', err.message);
next(err);
}
}
async function findNlc(req, res, next){
try {
var id = req.params.id;
res.json(await find.nlc(id));
} catch (err) {
console.error('Unknown Error', err.message);
next(err);
}
}
async function findTiploc(req, res, next){
try {
var id = req.params.id;
res.json(await find.tiploc(id));
} catch (err) {
console.error('Unknown Error', err.message);
next(err);
}
}
async function findStanox(req, res, next){
try {
var id = req.params.id;
res.json(await find.stanox(id));
} catch (err) {
console.error('Unknown Error', err.message);
next(err);
}
}
module.exports = {
findName,
findCrs,
findNlc,
findTiploc,
findStanox
};