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

This commit is contained in:
Maxime Delporte
2025-11-07 11:57:04 +01:00
parent 1270a3bda6
commit b76496e096
2 changed files with 21 additions and 10 deletions

View File

@@ -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.