diff --git a/server/handler/repo.go b/server/handler/repo.go index a299bc2a6..2bf54bcdf 100644 --- a/server/handler/repo.go +++ b/server/handler/repo.go @@ -86,13 +86,13 @@ func DelRepo(c web.C, w http.ResponseWriter, r *http.Request) { } } -// PatchRepo accepts a request to inactivate the named +// DeactivateRepo accepts a request to deactivate the named // repository. This will disable all builds in the system // for this repository. // -// PATCH /api/repos/:host/:owner/:name +// POST /api/repos/:host/:owner/:name/deactivate // -func PatchRepo(c web.C, w http.ResponseWriter, r *http.Request) { +func DeactivateRepo(c web.C, w http.ResponseWriter, r *http.Request) { var ctx = context.FromC(c) var repo = ToRepo(c) @@ -106,7 +106,7 @@ func PatchRepo(c web.C, w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) return } - w.WriteHeader(http.StatusNoContent) + json.NewEncoder(w).Encode(repo) } // PostRepo accapets a request to activate the named repository diff --git a/server/router/router.go b/server/router/router.go index 51bc2c6d0..b197d0672 100644 --- a/server/router/router.go +++ b/server/router/router.go @@ -46,7 +46,7 @@ func New() *web.Mux { repos.Put("/api/repos/:host/:owner/:name", handler.PutRepo) repos.Post("/api/repos/:host/:owner/:name", handler.PostRepo) repos.Delete("/api/repos/:host/:owner/:name", handler.DelRepo) - repos.Patch("/api/repos/:host/:owner/:name", handler.PatchRepo) + repos.Post("/api/repos/:host/:owner/:name/deactivate", handler.DeactivateRepo) mux.Handle("/api/repos/:host/:owner/:name", repos) mux.Handle("/api/repos/:host/:owner/:name/*", repos)