aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-06-07 16:24:21 +0100
committerMatthew Lemon <y@yulqen.org>2024-06-07 16:24:21 +0100
commit05929682f76749335598b015c35103dd48096935 (patch)
tree47fa89676d00cfd86618fa3ffdde29195ecc7b62
parent4c248acc185740c535bc7dc14ae9a363cac3382f (diff)
Reverts the use of Pretty for actual API useHEADmaster
-rw-r--r--cmd/dbasik-api/handlers.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/dbasik-api/handlers.go b/cmd/dbasik-api/handlers.go
index 0f3bc92..7a8f6e1 100644
--- a/cmd/dbasik-api/handlers.go
+++ b/cmd/dbasik-api/handlers.go
@@ -93,13 +93,13 @@ func (app *application) createReturnHandler(w http.ResponseWriter, r *http.Reque
app.serverErrorResponse(w, r, err)
}
- err = app.writeJSONPretty(w, http.StatusOK, envelope{"Return": ret}, nil)
+ err = app.writeJSON(w, http.StatusOK, envelope{"return": ret}, nil)
if err != nil {
app.logger.Debug("writing out csv", "err", err)
app.serverErrorResponse(w, r, err)
}
- fmt.Fprintf(w, "file successfully uploaded\n")
+ // fmt.Fprintf(w, "file successfully uploaded\n")
}
@@ -152,13 +152,13 @@ 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, envelope{"Datamap": dm}, nil)
+ err = app.writeJSON(w, http.StatusOK, envelope{"datamap": dm}, nil)
if err != nil {
app.logger.Debug("writing out csv", "err", err)
app.serverErrorResponse(w, r, err)
}
- fmt.Fprintf(w, "file successfully uploaded")
+ // fmt.Fprintf(w, "file successfully uploaded")
}
func (app *application) saveDatamapHandler(w http.ResponseWriter, r *http.Request) {