MCPcopy Index your code
hub / github.com/coder/coder / templatesByOrganization

Method templatesByOrganization

coderd/templates.go:534–543  ·  view source on GitHub ↗

@Summary Get templates by organization @Description Returns a list of templates for the specified organization. @Description By default, only non-deprecated templates are returned. @Description To include deprecated templates, specify `deprecated:true` in the search query. @ID get-templates-by-organ

()

Source from the content-addressed store, hash-verified

532// @Success 200 {array} codersdk.Template
533// @Router /api/v2/organizations/{organization}/templates [get]
534func (api *API) templatesByOrganization() http.HandlerFunc {
535 // TODO: Should deprecate this endpoint and make it akin to /workspaces with
536 // a filter. There isn't a need to make the organization filter argument
537 // part of the query url.
538 // mutate the filter to only include templates from the given organization.
539 return api.fetchTemplates(func(r *http.Request, arg *database.GetTemplatesWithFilterParams) {
540 organization := httpmw.OrganizationParam(r)
541 arg.OrganizationID = organization.ID
542 })
543}
544
545// @Summary Get all templates
546// @Description Returns a list of templates.

Callers 1

NewFunction · 0.95

Calls 2

fetchTemplatesMethod · 0.95
OrganizationParamFunction · 0.92

Tested by

no test coverage detected