Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix existing tests
  • Loading branch information
f0ssel committed Dec 7, 2022
commit 90e6a9d0dde8f118d53b2fa536acd7aca96f9bbc
12 changes: 10 additions & 2 deletions coderd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,16 @@ func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(ctx, rw, http.StatusOK, resp)
}

func (*API) templateExamples(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
func (api *API) templateExamples(rw http.ResponseWriter, r *http.Request) {
var (
ctx = r.Context()
organization = httpmw.OrganizationParam(r)
)

if !api.Authorize(r, rbac.ActionRead, rbac.ResourceTemplate.InOrg(organization.ID)) {
httpapi.ResourceNotFound(rw)
return
}

ex, err := examples.List()
if err != nil {
Expand Down