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
+2 -4
View File
@@ -7,8 +7,6 @@ import (
"fmt"
"net/http"
"github.com/go-chi/render"
"github.com/coder/coder/coderd/awsidentity"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
@@ -134,8 +132,8 @@ func (api *api) handleAuthInstanceID(rw http.ResponseWriter, r *http.Request, in
})
return
}
render.Status(r, http.StatusOK)
render.JSON(rw, r, codersdk.WorkspaceAgentAuthenticateResponse{
httpapi.Write(rw, http.StatusOK, codersdk.WorkspaceAgentAuthenticateResponse{
SessionToken: agent.AuthToken.String(),
})
}