Fix reasonCode endpoint

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-06-18 21:28:25 +01:00
parent 34d00ad16f
commit 199a1760b7
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
const version = { const version = {
api: ['/api/v1/','/api/v2'], api: ['/api/v1/','/api/v2'],
app: '2023.6.8' app: '2023.6.9'
}; };
module.exports = version; module.exports = version;

View File

@ -8,8 +8,10 @@ async function getReasonCode(req, res, next) {
const code = req.params.code; const code = req.params.code;
if (code === 'all') { if (code === 'all') {
res.json(await ldb.getReasonCodeList()); res.json(await ldb.getReasonCodeList());
next;
} }
res.json(await ldb.getReasonCode(code)); res.json(await ldb.getReasonCode(code));
next;
} catch (err) { } catch (err) {
console.error('ERROR', err.message); console.error('ERROR', err.message);
err.status = 500; err.status = 500;