ch3.4
This commit is contained in:
@@ -28,7 +28,7 @@ func (app *application) showMovieHandler(w http.ResponseWriter, r *http.Request)
|
||||
Version: 1,
|
||||
}
|
||||
|
||||
err = app.writeJSON(w, http.StatusOK, movie, nil)
|
||||
err = app.writeJSON(w, http.StatusOK, envelope{"movie": movie}, nil)
|
||||
if err != nil {
|
||||
app.logger.Print(err)
|
||||
http.Error(w, "The server encountered a problem and could not process your request", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user