mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Hook up route
This commit is contained in:
@@ -469,6 +469,7 @@ func New(options *Options) *API {
|
||||
apiKeyMiddleware,
|
||||
)
|
||||
r.Get("/", api.workspaces)
|
||||
r.Get("/count", api.workspaceCount)
|
||||
r.Route("/{workspace}", func(r chi.Router) {
|
||||
r.Use(
|
||||
httpmw.ExtractWorkspaceParam(options.Database),
|
||||
|
||||
+4
-7
@@ -303,13 +303,10 @@ export const getWorkspacesCount = async (
|
||||
if (options.q) {
|
||||
searchParams.set("q", options.q)
|
||||
}
|
||||
// TODO
|
||||
// const response = await axios.get(
|
||||
// `/api/v2/workspaces/count?${searchParams.toString()}`,
|
||||
// )
|
||||
// return response.data
|
||||
|
||||
return Promise.resolve({ count: 10 })
|
||||
const response = await axios.get(
|
||||
`/api/v2/workspaces/count?${searchParams.toString()}`,
|
||||
)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export const getWorkspaceByOwnerAndName = async (
|
||||
|
||||
@@ -17,7 +17,7 @@ const WorkspacesPage: FC = () => {
|
||||
const [workspacesState, send] = useMachine(workspacesMachine, {
|
||||
context: {
|
||||
page: currentPage,
|
||||
limit: 2, //TODO
|
||||
limit: 25,
|
||||
filter,
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user