From 9586619252b5ca0e8d24bc3d4c800ed0ad4cb065 Mon Sep 17 00:00:00 2001 From: Andrew van der Stock Date: Sun, 6 Jun 2021 08:09:04 -0600 Subject: [PATCH] Allow factions, systems, and stations to have pasted spaces Many tools copy additional whitespace. This small enhancement ignores these pasted values. I decided to do this in the frontend only, because the backend API is assumed to be called by folks who can trim if they want to do so. --- frontend/src/components/main/stations/StationList.vue | 4 ++-- frontend/src/mixins/factionMethods.js | 2 +- frontend/src/mixins/systemMethods.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/main/stations/StationList.vue b/frontend/src/components/main/stations/StationList.vue index 3a2100d4..ab59ef05 100644 --- a/frontend/src/components/main/stations/StationList.vue +++ b/frontend/src/components/main/stations/StationList.vue @@ -88,7 +88,7 @@ export default { this.loading = true return this.$store.dispatch('fetchStations', { page: this.page, - beginsWith: value.newValue + beginsWith: value.newValue.trim() }) }) ) @@ -114,7 +114,7 @@ export default { this.loading = true let stationsPaginated = await this.$store.dispatch('fetchStations', { page: this.page, - beginsWith: this.stationName + beginsWith: this.stationName.trim() }) this.setStations(stationsPaginated.docs) this.totalStations = stationsPaginated.total diff --git a/frontend/src/mixins/factionMethods.js b/frontend/src/mixins/factionMethods.js index 4a34964d..4b48ed35 100644 --- a/frontend/src/mixins/factionMethods.js +++ b/frontend/src/mixins/factionMethods.js @@ -3,7 +3,7 @@ export default { fetchFactionsCall(page, factionName) { return this.$store.dispatch('fetchFactions', { page: page, - beginsWith: factionName + beginsWith: factionName.trim() }) } } diff --git a/frontend/src/mixins/systemMethods.js b/frontend/src/mixins/systemMethods.js index fe2425a0..e130fe78 100644 --- a/frontend/src/mixins/systemMethods.js +++ b/frontend/src/mixins/systemMethods.js @@ -3,7 +3,7 @@ export default { fetchSystemsCall(page, systemName) { return this.$store.dispatch('fetchSystems', { page: page, - beginsWith: systemName + beginsWith: systemName.trim() }) } }