From 2d84d48c3aa84914fb236a3b0c78bc84b52c4653 Mon Sep 17 00:00:00 2001 From: Eoin McAfee Date: Thu, 20 May 2021 14:24:31 +0100 Subject: [PATCH] Fixed issue with routing for templates. --- handler/api/api.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/handler/api/api.go b/handler/api/api.go index 9384cad72..8037158f7 100644 --- a/handler/api/api.go +++ b/handler/api/api.go @@ -359,12 +359,12 @@ func (s Server) Handler() http.Handler { r.Route("/templates", func(r chi.Router) { r.With(acl.AuthorizeAdmin).Get("/", template.HandleAll(s.Template)) - r.With(acl.CheckMembership(s.Orgs, false)).Get("/{namespace}", template.HandleList(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Post("/{namespace}", template.HandleCreate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, false)).Get("/{namespace}/{name}", template.HandleFind(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Post("/{namespace}/{name}", template.HandleUpdate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Patch("/{namespace}/{name}", template.HandleUpdate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Delete("/{namespace}/{name}", template.HandleDelete(s.Template)) + r.With(acl.CheckMembership(s.Orgs, false)).Get("/", template.HandleList(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Post("/", template.HandleCreate(s.Template)) + r.With(acl.CheckMembership(s.Orgs, false)).Get("/{name}", template.HandleFind(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Put("/{name}", template.HandleUpdate(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Patch("/{name}", template.HandleUpdate(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Delete("/{name}", template.HandleDelete(s.Template)) }) r.Route("/system", func(r chi.Router) {