Skip to content

Commit a9f04f3

Browse files
committed
move files
1 parent da9fc00 commit a9f04f3

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

coderd/templates.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/coder/coder/coderd/rbac"
2424
"github.com/coder/coder/coderd/telemetry"
2525
"github.com/coder/coder/codersdk"
26+
"github.com/coder/coder/examples"
2627
)
2728

2829
// Auto-importable templates. These can be auto-imported after the first user
@@ -564,6 +565,21 @@ func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) {
564565
httpapi.Write(ctx, rw, http.StatusOK, resp)
565566
}
566567

568+
func (*API) templateExamples(rw http.ResponseWriter, r *http.Request) {
569+
ctx := r.Context()
570+
571+
ex, err := examples.List()
572+
if err != nil {
573+
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
574+
Message: "Internal error fetching examples.",
575+
Detail: err.Error(),
576+
})
577+
return
578+
}
579+
580+
httpapi.Write(ctx, rw, http.StatusOK, ex)
581+
}
582+
567583
type autoImportTemplateOpts struct {
568584
name string
569585
archive []byte

coderd/users.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -825,21 +825,6 @@ func (api *API) putUserRoles(rw http.ResponseWriter, r *http.Request) {
825825
httpapi.Write(ctx, rw, http.StatusOK, convertUser(updatedUser, organizationIDs))
826826
}
827827

828-
func (_ *API) templateExamples(rw http.ResponseWriter, r *http.Request) {
829-
ctx := r.Context()
830-
831-
ex, err := examples.List()
832-
if err != nil {
833-
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
834-
Message: "Internal error fetching examples.",
835-
Detail: err.Error(),
836-
})
837-
return
838-
}
839-
840-
httpapi.Write(ctx, rw, http.StatusOK, ex)
841-
}
842-
843828
// updateSiteUserRoles will ensure only site wide roles are passed in as arguments.
844829
// If an organization role is included, an error is returned.
845830
func (api *API) updateSiteUserRoles(ctx context.Context, args database.UpdateUserRolesParams) (database.User, error) {

0 commit comments

Comments
 (0)