ch3.6
This commit is contained in:
@@ -15,7 +15,7 @@ func (app *application) createMovieHandler(w http.ResponseWriter, r *http.Reques
|
||||
func (app *application) showMovieHandler(w http.ResponseWriter, r *http.Request) {
|
||||
id, err := app.readIDParam(r)
|
||||
if err != nil {
|
||||
http.NotFound(w, r)
|
||||
app.notFoundResponse(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ func (app *application) showMovieHandler(w http.ResponseWriter, r *http.Request)
|
||||
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)
|
||||
app.serverErrorResponse(w, r, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user