Update reasonCode endpoints to read from DB rather than API

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-06-12 18:28:28 +01:00
parent 4916c377c6
commit f0b8e46007
2 changed files with 7 additions and 6 deletions

View File

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

View File

@ -88,9 +88,8 @@ async function getServiceByRID(rid) {
async function getReasonCodeList() {
log.out('ldbService.getReasonCodeList: Fetching reason code list', 'eror');
try {
const api = new ldb(ldbsvKey,true);
const options = {};
return await api.call('GetReasonCodeList', options, true, false);
const dbFilter = {};
return await db.query('reasonCodes', dbFilter, false);
} catch (err) {
log.out(`ldbService.getReasonCodeList: ${err}`, 'eror');
}
@ -99,8 +98,10 @@ async function getReasonCodeList() {
async function getReasonCode(code) {
log.out(`ldbService.getReasonCode: Fetching reason code ${code}`, 'dbug');
try {
const api = new ldb(ldbsvKey, true);
return await api.call('GetReasonCode', {reasonCode: code}, true, false);
const dbFilter = {
code: code
};
return await db.query('reasonCodes', dbFilter, false);
} catch (err) {
log.out(`ldbService.getReasonCode: ${err}`, 'eror');
}