@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
()
| 532 | // @Success 200 {array} codersdk.Template |
| 533 | // @Router /api/v2/organizations/{organization}/templates [get] |
| 534 | func (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. |
no test coverage detected