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)); const diff = Math.max(0, Math.round(msDifference / 60000));
return diff; return diff;
}, },
limitLength(str) {
return str;
},
}, },
computed: { computed: {
/* API endpoint, either for self-hosted or managed instance */
isLocationId() { isLocationId() {
if (!this.options.location) { if (!this.options.location) {
this.error('Location is required'); this.error('Location is required');
@ -91,8 +87,7 @@ export default {
return 0; return 0;
}, },
limit() { limit() {
if (this.options.limit) return this.options.limit; return this.options.limit || 10;
return 10;
}, },
endpointDeparture() { endpointDeparture() {
return `${widgetApiEndpoints.mvg}/departure?globalId=${this.location}&limit=30&offsetInMinutes=${this.offset}&transportTypes=UBAHN,TRAM,BUS,SBAHN`; 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)); const diff = Math.max(0, Math.round(msDifference / 60000));
return diff; return diff;
}, },
limitLength(str) {
return str;
},
formatTime(str) { formatTime(str) {
const d = new Date(Date.parse(str)); const d = new Date(Date.parse(str));
function ii(i) { function ii(i) {
@ -155,7 +152,7 @@ export default {
return `${widgetApiEndpoints.mvg}/location?query=${encodeURIComponent(loc)}`; return `${widgetApiEndpoints.mvg}/location?query=${encodeURIComponent(loc)}`;
}, },
endpointConnection() { 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() { update() {
this.startLoading(); this.startLoading();