Skip to content

Commit 5b343c2

Browse files
committed
Move workspace function
1 parent bdedbf4 commit 5b343c2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

coderd/workspaces.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ func (w *workspaces) allWorkspacesForProject(rw http.ResponseWriter, r *http.Req
7676
render.JSON(rw, r, apiWorkspaces)
7777
}
7878

79-
// workspace returns a new workspace.
80-
func (*workspaces) workspace(rw http.ResponseWriter, r *http.Request) {
81-
workspace := httpmw.WorkspaceParam(r)
82-
83-
render.Status(r, http.StatusOK)
84-
render.JSON(rw, r, convertWorkspace(workspace))
85-
}
86-
8779
// createWorkspace creates a new workspace for the currently authenticated user.
8880
func (w *workspaces) createWorkspace(rw http.ResponseWriter, r *http.Request) {
8981
var createWorkspace CreateWorkspaceRequest
@@ -140,6 +132,14 @@ func (w *workspaces) createWorkspace(rw http.ResponseWriter, r *http.Request) {
140132
render.JSON(rw, r, convertWorkspace(workspace))
141133
}
142134

135+
// workspace returns a new workspace.
136+
func (*workspaces) workspace(rw http.ResponseWriter, r *http.Request) {
137+
workspace := httpmw.WorkspaceParam(r)
138+
139+
render.Status(r, http.StatusOK)
140+
render.JSON(rw, r, convertWorkspace(workspace))
141+
}
142+
143143
// convertWorkspace consumes the database representation and outputs an API friendly representation.
144144
func convertWorkspace(workspace database.Workspace) Workspace {
145145
return Workspace(workspace)

0 commit comments

Comments
 (0)