# HG changeset patch # User Bernhard Reiter # Date 1549557900 -3600 # Node ID 7267f81681765e243df58c79f441c6fbe860db79 # Parent ba43b29e869415074f98b59a206c1aa5646b218b Extending endpoint /surveys to return depth_reference * Extending the endpoint because the depth_reference is an attribute of the survey and could be different in principle between several surveys. diff -r ba43b29e8694 -r 7267f8168176 pkg/controllers/surveys.go --- a/pkg/controllers/surveys.go Thu Feb 07 17:15:33 2019 +0100 +++ b/pkg/controllers/surveys.go Thu Feb 07 17:45:00 2019 +0100 @@ -28,6 +28,7 @@ SELECT s.bottleneck_id, s.date_info::text, + s.depth_reference, bg.objname AS gauge_objname FROM ( SELECT * FROM waterway.bottlenecks AS b, waterway.gauges AS g @@ -61,6 +62,7 @@ if err = rows.Scan( &survey.BottleneckID, &survey.DateInfo, + &survey.DepthReference, &survey.ReferenceGauge, ); err != nil { return diff -r ba43b29e8694 -r 7267f8168176 pkg/models/surveys.go --- a/pkg/models/surveys.go Thu Feb 07 17:15:33 2019 +0100 +++ b/pkg/models/surveys.go Thu Feb 07 17:45:00 2019 +0100 @@ -17,6 +17,7 @@ Survey struct { BottleneckID string `json:"bottleneck_id"` DateInfo string `json:"date_info"` + DepthReference string `json:"depth_reference"` ReferenceGauge string `json:"gauge_objname"` } )