Skip to content

Commit 2aac32b

Browse files
committed
Fix js test
1 parent e9e913d commit 2aac32b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

coderd/workspaces.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"errors"
88
"fmt"
99
"net/http"
10-
"net/url"
1110
"strconv"
1211
"time"
1312

@@ -117,7 +116,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
117116
}
118117

119118
// Set all the query params from the "q" field.
120-
q := url.Values{}
119+
q := r.URL.Query()
121120
for k, v := range values {
122121
// Do not allow overriding if the user also set query param fields
123122
// outside the query string.

site/src/api/api.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ describe("api.ts", () => {
118118
it.each<[TypesGen.WorkspaceFilter | undefined, string]>([
119119
[undefined, "/api/v2/workspaces"],
120120

121-
[{ organization_id: "1", owner: "" }, "/api/v2/workspaces?organization_id=1"],
122-
[{ organization_id: "", owner: "1" }, "/api/v2/workspaces?owner=1"],
121+
[{ owner: "" }, "/api/v2/workspaces"],
122+
[{ owner: "1" }, "/api/v2/workspaces?owner=1"],
123123

124-
[{ organization_id: "1", owner: "me" }, "/api/v2/workspaces?organization_id=1&owner=me"],
124+
[{ owner: "me" }, "/api/v2/workspaces?owner=me"],
125125
])(`getWorkspacesURL(%p) returns %p`, (filter, expected) => {
126126
expect(getWorkspacesURL(filter)).toBe(expected)
127127
})

0 commit comments

Comments
 (0)