58 lines
1.1 KiB
JavaScript
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
|
|
}; |