@@ -138,9 +138,9 @@ func (api *API) deleteTemplate(rw http.ResponseWriter, r *http.Request) {
138
138
// @Produce json
139
139
// @Tags Templates
140
140
// @Param request body codersdk.CreateTemplateRequest true "Request body"
141
- // @Param organization-id path string true "Organization ID"
141
+ // @Param organization path string true "Organization ID"
142
142
// @Success 200 {object} codersdk.Template
143
- // @Router /organizations/{organization-id }/templates/ [post]
143
+ // @Router /organizations/{organization}/templates [post]
144
144
// Returns a single template.
145
145
// Create a new template in an organization.
146
146
func (api * API ) postTemplateByOrganization (rw http.ResponseWriter , r * http.Request ) {
@@ -336,7 +336,7 @@ func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Reque
336
336
// @Produce json
337
337
// @Tags Templates
338
338
// @Param organization path string true "Organization ID" format(uuid)
339
- // @Success 200 {object} [] codersdk.Template
339
+ // @Success 200 {array} codersdk.Template
340
340
// @Router /organizations/{organization}/templates [get]
341
341
func (api * API ) templatesByOrganization (rw http.ResponseWriter , r * http.Request ) {
342
342
ctx := r .Context ()
@@ -402,9 +402,9 @@ func (api *API) templatesByOrganization(rw http.ResponseWriter, r *http.Request)
402
402
// @Produce json
403
403
// @Tags Templates
404
404
// @Param organization path string true "Organization ID" format(uuid)
405
- // @Param template-name path string true "Template name"
405
+ // @Param templatename path string true "Template name"
406
406
// @Success 200 {object} codersdk.Template
407
- // @Router /organizations/{organization}/templates/{template-name } [get]
407
+ // @Router /organizations/{organization}/templates/{templatename } [get]
408
408
func (api * API ) templateByOrganizationAndName (rw http.ResponseWriter , r * http.Request ) {
409
409
ctx := r .Context ()
410
410
organization := httpmw .OrganizationParam (r )
@@ -588,6 +588,14 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
588
588
httpapi .Write (ctx , rw , http .StatusOK , api .convertTemplate (updated , count , createdByNameMap [updated .ID .String ()]))
589
589
}
590
590
591
+ // @Summary Get template DAUs by ID
592
+ // @ID get-template-daus-by-id
593
+ // @Security CoderSessionToken
594
+ // @Produce json
595
+ // @Tags Templates
596
+ // @Param id path string true "Template ID" format(uuid)
597
+ // @Success 200 {object} codersdk.TemplateDAUsResponse
598
+ // @Router /templates/{id}/daus [get]
591
599
func (api * API ) templateDAUs (rw http.ResponseWriter , r * http.Request ) {
592
600
ctx := r .Context ()
593
601
template := httpmw .TemplateParam (r )
@@ -606,6 +614,14 @@ func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) {
606
614
httpapi .Write (ctx , rw , http .StatusOK , resp )
607
615
}
608
616
617
+ // @Summary Get template examples by organization
618
+ // @ID get-template-examples-by-organization
619
+ // @Security CoderSessionToken
620
+ // @Produce json
621
+ // @Tags Templates
622
+ // @Param organization path string true "Organization ID" format(uuid)
623
+ // @Success 200 {array} codersdk.TemplateExample
624
+ // @Router /organizations/{organization}/templates/examples [get]
609
625
func (api * API ) templateExamples (rw http.ResponseWriter , r * http.Request ) {
610
626
var (
611
627
ctx = r .Context ()
0 commit comments