# HG changeset patch # User Thomas Junk # Date 1559634624 -7200 # Node ID 7b15a6dd4ae56c8aeb4dbe3a964e1f5ccc398e44 # Parent 391afcc961a2e4fb38221909d41c1aa7b9cf189b search: replace commata via SQL diff -r 391afcc961a2 -r 7b15a6dd4ae5 client/src/components/Search.vue --- a/client/src/components/Search.vue Mon Jun 03 18:37:12 2019 +0200 +++ b/client/src/components/Search.vue Tue Jun 04 09:50:24 2019 +0200 @@ -70,7 +70,7 @@ class="mr-1" fixed-width /> - {{ entry.name }} {{ normalizeLocationCode(entry.locationcode) }} + {{ entry.name }} {{ entry.locationcode }} @@ -239,10 +239,6 @@ } }, methods: { - normalizeLocationCode(code) { - if (!code) return ""; - return code.split(",").join(""); - }, loadLogs() { this.$store .dispatch("imports/getImports", { diff -r 391afcc961a2 -r 7b15a6dd4ae5 pkg/controllers/search.go --- a/pkg/controllers/search.go Mon Jun 03 18:37:12 2019 +0200 +++ b/pkg/controllers/search.go Tue Jun 04 09:50:24 2019 +0200 @@ -27,7 +27,7 @@ const ( searchHectometreSQL = `SELECT COALESCE(json_agg(r),'[]') FROM (SELECT (location_code).hectometre || ' rhm' AS name, - concat(location_code) AS locationcode, + replace(concat(location_code), ',','') AS locationcode, ST_AsGeoJSON(geom)::json AS geom, 'rhm' AS type FROM waterway.distance_marks_virtual WHERE (location_code).hectometre = $1) r`