Skip to content

Commit

Permalink
Added line to Departures
Browse files Browse the repository at this point in the history
  • Loading branch information
BolverBlitz committed Mar 10, 2024
1 parent 87fa73c commit 009d289
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class openvgn {
* This will list all departures from a given stop.
* @param {String} target Stop ID or VAG haltid
* @param {Object} parameter Quary parameter
* @param {String} [parameter.Line] Only return departures of one line
* @param {String} [parameter.Product] Only return departures of one or multiple products
* @param {Number} [parameter.TimeSpan] Return departures until that time
* @param {Number} [parameter.TimeDelay] Look for now + x in minutes
Expand All @@ -142,6 +143,8 @@ class openvgn {
source = "vag";
};
let url = `${this.api_url}/abfahrten.json/${source}/${target}`;
if(parameter.Line) url = `${url}/${parameter.Line}`;

if (parameter) {
url = `${url}?${this.#encodeQueryData(parameter, "Departures")}`;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oepnv-nuremberg",
"version": "0.3.1",
"version": "0.3.2",
"description": "A wrapper for multiple datapoints from VAG and VGN",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 009d289

Please sign in to comment.