Skip to content

Commit f501786

Browse files
committed
Hook up route
1 parent 2a8c1b3 commit f501786

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

coderd/coderd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ func New(options *Options) *API {
469469
apiKeyMiddleware,
470470
)
471471
r.Get("/", api.workspaces)
472+
r.Get("/count", api.workspaceCount)
472473
r.Route("/{workspace}", func(r chi.Router) {
473474
r.Use(
474475
httpmw.ExtractWorkspaceParam(options.Database),

site/src/api/api.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,10 @@ export const getWorkspacesCount = async (
303303
if (options.q) {
304304
searchParams.set("q", options.q)
305305
}
306-
// TODO
307-
// const response = await axios.get(
308-
// `/api/v2/workspaces/count?${searchParams.toString()}`,
309-
// )
310-
// return response.data
311-
312-
return Promise.resolve({ count: 10 })
306+
const response = await axios.get(
307+
`/api/v2/workspaces/count?${searchParams.toString()}`,
308+
)
309+
return response.data
313310
}
314311

315312
export const getWorkspaceByOwnerAndName = async (

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const WorkspacesPage: FC = () => {
1717
const [workspacesState, send] = useMachine(workspacesMachine, {
1818
context: {
1919
page: currentPage,
20-
limit: 2, //TODO
20+
limit: 25,
2121
filter,
2222
},
2323
actions: {

0 commit comments

Comments
 (0)