fix: UPDATE route routes-by-agency-id
This commit is contained in:
parent
74c8bef18c
commit
f3a5a31240
|
@ -209,6 +209,7 @@ APP.use('/trips-oset-limit',tripsOsetLimit);
|
|||
APP.use('/routes',routesByAgencyId);
|
||||
|
||||
//count
|
||||
//get route count by providing agency_id
|
||||
APP.use('/route-count', ROUTECOUNT);
|
||||
APP.use('/trip-count', TRIPCOUNT);
|
||||
APP.use('/number-of-routes', numberOfRoutes);
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
const debug=require('debug')('debug');
|
||||
require('dotenv').config();
|
||||
|
||||
const db = require('./db');
|
||||
|
||||
async function get(agencyId = 0) {
|
||||
//debug('routes-by-agency-id start...');
|
||||
//debug('agencyId: '+agencyId);
|
||||
|
||||
const schema = process.env.DB_SCHEMA || 'schema';
|
||||
debug('schema: ' + schema );
|
||||
const query = `SELECT routes.route_id FROM ` + schema + `.routes WHERE agency_id='${agencyId}';`;
|
||||
return await db.query(query);
|
||||
};
|
||||
|
||||
const QUERY=`SELECT routes.route_id FROM ` + schema + `.routes WHERE agency_id='${agencyId}';`
|
||||
//debug('QUERY: '+QUERY);
|
||||
const res=await db.query(QUERY);
|
||||
//debug('routes-by-agency-id done.');
|
||||
return res;
|
||||
}
|
||||
module.exports = {
|
||||
get
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue