changeset 4159:80e9cfb2be98

Fixed duplicates in list surveys endpoint.
author Sascha Wilde <wilde@intevation.de>
date Fri, 02 Aug 2019 16:37:24 +0200
parents 5466562cca60
children 7cccf7fef3e8
files pkg/controllers/surveys.go
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/surveys.go	Fri Aug 02 16:10:42 2019 +0200
+++ b/pkg/controllers/surveys.go	Fri Aug 02 16:37:24 2019 +0200
@@ -38,7 +38,7 @@
   LEFT JOIN waterway.gauges_reference_water_levels AS r
     ON s.depth_reference = r.depth_reference
       AND g.location = r.location AND g.validity = r.validity
-WHERE b.objnam = $1`
+WHERE b.objnam = $1 AND s.date_info::timestamptz <@ b.validity`
 )
 
 func listSurveys(