mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: index template versions by template and name (#5993)
* fix: index template versions by template and name We were incorrectly returning template versions by name relative to organizations. This could result in an incorrect version being returned if multiple templates had versions with the same name. * Fix auth referencing * Fix route location * Fix authorize route name * Fix previous call * Fix authorize route name
This commit is contained in:
@ -398,16 +398,18 @@ func New(options *Options) *API {
|
||||
httpmw.ExtractOrganizationParam(options.Database),
|
||||
)
|
||||
r.Get("/", api.organization)
|
||||
r.Route("/templateversions", func(r chi.Router) {
|
||||
r.Post("/", api.postTemplateVersionsByOrganization)
|
||||
r.Get("/{templateversionname}", api.templateVersionByOrganizationAndName)
|
||||
r.Get("/{templateversionname}/previous", api.previousTemplateVersionByOrganizationAndName)
|
||||
})
|
||||
r.Post("/templateversions", api.postTemplateVersionsByOrganization)
|
||||
r.Route("/templates", func(r chi.Router) {
|
||||
r.Post("/", api.postTemplateByOrganization)
|
||||
r.Get("/", api.templatesByOrganization)
|
||||
r.Get("/{templatename}", api.templateByOrganizationAndName)
|
||||
r.Get("/examples", api.templateExamples)
|
||||
r.Route("/{templatename}", func(r chi.Router) {
|
||||
r.Get("/", api.templateByOrganizationAndName)
|
||||
r.Route("/versions/{templateversionname}", func(r chi.Router) {
|
||||
r.Get("/", api.templateVersionByOrganizationTemplateAndName)
|
||||
r.Get("/previous", api.previousTemplateVersionByOrganizationTemplateAndName)
|
||||
})
|
||||
})
|
||||
})
|
||||
r.Route("/members", func(r chi.Router) {
|
||||
r.Get("/roles", api.assignableOrgRoles)
|
||||
|
Reference in New Issue
Block a user