diff pkg/controllers/surveys.go @ 4159:80e9cfb2be98

Fixed duplicates in list surveys endpoint.
author Sascha Wilde <wilde@intevation.de>
date Fri, 02 Aug 2019 16:37:24 +0200
parents 02d5c2e17eb8
children 1458c9b0fdaa
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(