Fixed as suggested

This commit is contained in:
Matthias Bilger 2023-01-22 18:22:24 +01:00
parent 75b06f8af8
commit 59118a54dd
2 changed files with 2 additions and 10 deletions

View File

@ -72,12 +72,8 @@ export default {
const diff = Math.max(0, Math.round(msDifference / 60000));
return diff;
},
limitLength(str) {
return str;
},
},
computed: {
/* API endpoint, either for self-hosted or managed instance */
isLocationId() {
if (!this.options.location) {
this.error('Location is required');
@ -91,8 +87,7 @@ export default {
return 0;
},
limit() {
if (this.options.limit) return this.options.limit;
return 10;
return this.options.limit || 10;
},
endpointDeparture() {
return `${widgetApiEndpoints.mvg}/departure?globalId=${this.location}&limit=30&offsetInMinutes=${this.offset}&transportTypes=UBAHN,TRAM,BUS,SBAHN`;

View File

@ -90,9 +90,6 @@ export default {
const diff = Math.max(0, Math.round(msDifference / 60000));
return diff;
},
limitLength(str) {
return str;
},
formatTime(str) {
const d = new Date(Date.parse(str));
function ii(i) {
@ -155,7 +152,7 @@ export default {
return `${widgetApiEndpoints.mvg}/location?query=${encodeURIComponent(loc)}`;
},
endpointConnection() {
return `${widgetApiEndpoints.mvg}/connection?${this.formatPoint(this.locations.origin, 'origin')}&${this.formatPoint(this.locations.destination, 'destination')}&routingDateTime=${(new Date()).toISOString()}&limit=30&offsetInMinutes=${this.offset}&transportTypes=${this.transportTypes}`;
return `${widgetApiEndpoints.mvg}/connection?${this.formatPoint(this.locations.origin, 'origin')}&${this.formatPoint(this.locations.destination, 'destination')}&routingDateTime=${(new Date()).toISOString()}&offsetInMinutes=${this.offset}&transportTypes=${this.transportTypes}`;
},
update() {
this.startLoading();