aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/api/datamaps.go
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-03-12 14:48:48 +0000
committerMatthew Lemon <y@yulqen.org>2024-03-12 14:48:48 +0000
commit6cf68f633d43b710ab9aa59948101f54b75593f7 (patch)
treeafcbb5c48a53dd529bab157b63c99d337a710777 /cmd/api/datamaps.go
parentcb1a75bd57d5a240a80f3fbcf980d386878c0530 (diff)
Wraps the JSON response in an envelope
Diffstat (limited to 'cmd/api/datamaps.go')
-rw-r--r--cmd/api/datamaps.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/api/datamaps.go b/cmd/api/datamaps.go
index 5133911..c58d811 100644
--- a/cmd/api/datamaps.go
+++ b/cmd/api/datamaps.go
@@ -74,7 +74,7 @@ func (app *application) createDatamapHandler(w http.ResponseWriter, r *http.Requ
}
dm = datamap{Name: dmName, Description: dmDesc, Created: time.Now(), DMLs: dmls}
- err = app.writeJSONPretty(w, http.StatusOK, dm, nil)
+ err = app.writeJSONPretty(w, http.StatusOK, envelope{"datamap": dm}, nil)
if err != nil {
app.logger.Debug("writing out csv", "err", err)
http.Error(w, "Cannot write output from parsed CSV", http.StatusInternalServerError)