Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
exported centers coordinates in csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
dreske committed Sep 15, 2021
1 parent f2aea68 commit c23d43d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/centers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 {
Expand Down

0 comments on commit c23d43d

Please sign in to comment.