# HG changeset patch # User Sascha Wilde # Date 1571759506 -7200 # Node ID fc082c611b8bdab3e2139dd88a6892dc806878e7 # Parent eb310f7e53b0cdf3f54ffc79dbf546d2275a9259 api/surveys list all existing surveys (no filter by gauge validity) The api endpoint is expected to deliver all SR available for the given bottleneck. diff -r eb310f7e53b0 -r fc082c611b8b pkg/controllers/surveys.go --- a/pkg/controllers/surveys.go Tue Oct 22 17:17:04 2019 +0200 +++ b/pkg/controllers/surveys.go Tue Oct 22 17:51:46 2019 +0200 @@ -28,7 +28,7 @@ const ( listSurveysSQL = ` -SELECT +SELECT DISTINCT s.bottleneck_id, s.date_info::text, s.depth_reference, @@ -41,7 +41,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 AND s.date_info::timestamptz <@ b.validity` +WHERE b.objnam = $1` ) func listSurveys(req *http.Request) (jr mw.JSONResult, err error) {