From c23d43d93f1a6030ee996e035c8574eaa363b67f Mon Sep 17 00:00:00 2001 From: Dirk Reske Date: Wed, 15 Sep 2021 09:39:07 +0200 Subject: [PATCH] exported centers coordinates in csv export --- src/api/centers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/centers.go b/src/api/centers.go index 9fb4c46..c4db103 100644 --- a/src/api/centers.go +++ b/src/api/centers.go @@ -196,7 +196,7 @@ func (c *Centers) AdminGetCentersCSV(w http.ResponseWriter, r *http.Request) { csvWriter := csv.NewWriter(w) csvWriter.Comma = ';' - if err := csvWriter.Write([]string{"subject", "operator", "uuid", "name", "address", "zip", "region", "dcc", "testkinds", "appointment", "message"}); err != nil { + if err := csvWriter.Write([]string{"subject", "operator", "uuid", "name", "address", "zip", "region", "dcc", "testkinds", "appointment", "longitude", "latitude", "message"}); err != nil { logrus.WithError(err).Error("Error writing response") return } @@ -212,6 +212,8 @@ func (c *Centers) AdminGetCentersCSV(w http.ResponseWriter, r *http.Request) { util.PtrToString(center.Region, ""), util.BoolToString(center.DCC, "false"), strings.Join(center.TestKinds, ","), + strconv.FormatFloat(center.Longitude, 'f', 10, 64), + strconv.FormatFloat(center.Latitude, 'f', 10, 64), util.PtrToString((*string)(center.Appointment), ""), util.PtrToString(center.Message, ""), }); err != nil {