fix: adjust API route trip*-by-route-day

This commit is contained in:
dancingCycle 2023-12-22 01:13:24 +01:00
parent 87b2d15a21
commit 150348a63d
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ async function get(routeid = 0, day = '2023-12-16') {
const schema = process.env.DB_SCHEMA || 'schema';
//TODO Sort by timestamp!
const query = `SELECT agency_name, agency_id, route_id, route_short_name, service_id, trip_id, trip_short_name, trip_headsign, timestamp_pgsql FROM ` + schema + `.vw_join_rts_trps_srvcs_pdts WHERE dates like '%${day}%' and route_id = '${routeid}';`
const query = `SELECT agency_name, agency_id, route_id, route_short_name, service_id, trip_id, trip_short_name, trip_headsign, timestamp_pgsql FROM ` + schema + `.vw_join_gncy_rts_trps_srvcs_pdts WHERE dates like '%${day}%' and route_id = '${routeid}';`
return await db.query(query);
};

View File

@ -10,7 +10,7 @@ const db = require('./db');
async function get(routeid = 0, day = '2023-2-29') {
const schema = process.env.DB_SCHEMA || 'schema';
const query = `SELECT trip_id, trip_short_name, trip_headsign FROM ` + schema + `.vw_join_rts_trps_srvcs WHERE dates like '%${day}%' and route_id = '${routeid}';`
const query = `SELECT agency_name, agency_id, route_id, route_short_name, service_id, trip_id, trip_short_name, trip_headsign FROM ` + schema + `.vw_join_gncy_rts_trps_srvcs WHERE dates like '%${day}%' and route_id = '${routeid}';`
return await db.query(query);
};