chore: idea: unify http responses further (#941)

This commit is contained in:
Garrett Delfosse
2022-04-12 10:17:33 -05:00
committed by GitHub
parent 4f0f216015
commit d9d4599ba9
16 changed files with 59 additions and 105 deletions
+1 -3
View File
@@ -6,7 +6,6 @@ import (
"fmt"
"net/http"
"github.com/go-chi/render"
"github.com/google/uuid"
"github.com/coder/coder/coderd/httpapi"
@@ -52,6 +51,5 @@ func (api *api) workspaceResource(rw http.ResponseWriter, r *http.Request) {
apiAgents = append(apiAgents, convertedAgent)
}
render.Status(r, http.StatusOK)
render.JSON(rw, r, convertWorkspaceResource(workspaceResource, apiAgents))
httpapi.Write(rw, http.StatusOK, convertWorkspaceResource(workspaceResource, apiAgents))
}