Skip to content

Commit

Permalink
fix text and arrival time:
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 2, 2024
1 parent e90508a commit 535362a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions handlers/train.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ class Train {
const result = await RenfeService.getNextMD(this._getOrigin(text), this._getDestination(text))

if (result) {
bot.say(target, `Próximo tren MD de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.time}`);
bot.say(target, `Próximo MD de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.departure} y llega a las ${result.arrival}`)
}
}
async getNextAVE (target, text, bot) {
const result = await RenfeService.getNextAVE(this._getOrigin(text), this._getDestination(text))

if (result) {
bot.say(target, `Próximo AVE de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.time} y llega a las ${result.arrival_time}`);
bot.say(target, `Próximo AVE de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.departure} y llega a las ${result.arrival}`)
}
}

Expand Down
2 changes: 1 addition & 1 deletion helpers/sqlManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ async function getCloserFutureTrain (origin, destination, type) {
try {
this.pool = await sql.connect(config.sql.connectionString)
const request = this.pool.request()
const result = await request.query(`SELECT TOP 1 CONVERT(VARCHAR(8),A.departure_time, 108) time , A.stop_name origin_stop, B.stop_name destination_stop, B.arrival_time arrival_time FROM
const result = await request.query(`SELECT TOP 1 CONVERT(VARCHAR(8),A.departure_time, 108) departure , A.stop_name origin_stop, B.stop_name destination_stop, CONVERT(VARCHAR(8),B.arrival_time, 108) arrival FROM
(SELECT ST.trip_id , S.stop_name, ST.stop_id, ST.stop_sequence, ST.departure_time
from stop_times ST
inner join stops S ON S.stop_id = ST.stop_id
Expand Down

0 comments on commit 535362a

Please sign in to comment.