2023-05-01 21:52:31 +01:00
|
|
|
const find = require('../services/find.services')
|
2023-02-09 20:34:53 +00:00
|
|
|
|
|
|
|
async function findName(req, res, next){
|
2023-05-01 21:52:31 +01:00
|
|
|
try {
|
|
|
|
var id = req.params.id
|
|
|
|
res.json(await find.name(id))
|
|
|
|
} catch (err) {
|
|
|
|
console.error('Unknown Error', err.message)
|
|
|
|
next(err)
|
|
|
|
}
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function findCrs(req, res, next){
|
2023-05-01 21:52:31 +01:00
|
|
|
try {
|
|
|
|
var id = req.params.id
|
|
|
|
res.json(await find.crs(id))
|
|
|
|
} catch (err) {
|
|
|
|
console.error('Unknown Error', err.message)
|
|
|
|
next(err)
|
|
|
|
}
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function findNlc(req, res, next){
|
2023-05-01 21:52:31 +01:00
|
|
|
try {
|
|
|
|
var id = req.params.id
|
|
|
|
res.json(await find.nlc(id))
|
|
|
|
} catch (err) {
|
|
|
|
console.error('Unknown Error', err.message)
|
|
|
|
next(err)
|
|
|
|
}
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function findTiploc(req, res, next){
|
2023-05-01 21:52:31 +01:00
|
|
|
try {
|
|
|
|
var id = req.params.id
|
|
|
|
res.json(await find.tiploc(id))
|
|
|
|
} catch (err) {
|
|
|
|
console.error('Unknown Error', err.message)
|
|
|
|
next(err)
|
|
|
|
}
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function findStanox(req, res, next){
|
2023-05-01 21:52:31 +01:00
|
|
|
try {
|
|
|
|
var id = req.params.id
|
|
|
|
res.json(await find.stanox(id))
|
|
|
|
} catch (err) {
|
|
|
|
console.error('Unknown Error', err.message)
|
|
|
|
next(err)
|
|
|
|
}
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
module.exports = {
|
2023-05-01 21:52:31 +01:00
|
|
|
findName,
|
|
|
|
findCrs,
|
|
|
|
findNlc,
|
|
|
|
findTiploc,
|
|
|
|
findStanox
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|