Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04db053

Browse files
committed
add new routes
1 parent dbf53df commit 04db053

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

coderd/workspaceagents.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"net/http"
99
"time"
1010

11-
"github.com/go-chi/render"
1211
"github.com/hashicorp/yamux"
1312
"golang.org/x/xerrors"
1413
"nhooyr.io/websocket"
@@ -32,8 +31,8 @@ func (api *api) workspaceAgent(rw http.ResponseWriter, r *http.Request) {
3231
})
3332
return
3433
}
35-
render.Status(r, http.StatusOK)
36-
render.JSON(rw, r, apiAgent)
34+
35+
httpapi.Write(rw, http.StatusOK, apiAgent)
3736
}
3837

3938
func (api *api) workspaceAgentDial(rw http.ResponseWriter, r *http.Request) {

coderd/workspaceresources.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"net/http"
88

9-
"github.com/go-chi/render"
109
"github.com/google/uuid"
1110

1211
"github.com/coder/coder/coderd/httpapi"
@@ -52,6 +51,5 @@ func (api *api) workspaceResource(rw http.ResponseWriter, r *http.Request) {
5251
apiAgents = append(apiAgents, convertedAgent)
5352
}
5453

55-
render.Status(r, http.StatusOK)
56-
render.JSON(rw, r, convertWorkspaceResource(workspaceResource, apiAgents))
54+
httpapi.Write(rw, http.StatusOK, convertWorkspaceResource(workspaceResource, apiAgents))
5755
}

0 commit comments

Comments
 (0)