Updating updateMovieHandler to be able to update only some fields (patch instead of put). Update routes with the correct verb.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m20s
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m20s
This commit is contained in:
@@ -24,7 +24,7 @@ func (app *application) routes() http.Handler {
|
||||
router.HandlerFunc(http.MethodGet, "/v1/healthcheck", app.healthcheckHandler)
|
||||
router.HandlerFunc(http.MethodPost, "/v1/movies", app.createMovieHandler)
|
||||
router.HandlerFunc(http.MethodGet, "/v1/movies/:id", app.showMovieHandler)
|
||||
router.HandlerFunc(http.MethodPut, "/v1/movies/:id", app.updateMovieHandler)
|
||||
router.HandlerFunc(http.MethodPatch, "/v1/movies/:id", app.updateMovieHandler)
|
||||
router.HandlerFunc(http.MethodDelete, "/v1/movies/:id", app.deleteMovieHandler)
|
||||
|
||||
// Return the httprouter instance.
|
||||
|
||||
Reference in New Issue
Block a user