Skip to content

Commit

Permalink
add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikGlinka committed Feb 26, 2024
1 parent 915970f commit b611d7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/rejseplanen/rejseplanen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default class Rejseplanen {
async init() {

const path = window.location.pathname.replace(/^(\/.*\.html)$/, '');

console.log('csv path: ' + path + this.#dataUrls.base + this.#dataUrls.stops);

this.#stops = await Csv.load(
path + this.#dataUrls.base + this.#dataUrls.stops,
Expand Down Expand Up @@ -74,6 +76,9 @@ export default class Rejseplanen {

async getDeparturesByStopName(name, limit = -1, journeyDetails = false) {
const stop = await this.getStopByName(name);

if (!stop) throw new Error('Stop not found');

return await this.getDeparturesByStopId(stop.id, limit, journeyDetails);
}

Expand Down

0 comments on commit b611d7b

Please sign in to comment.