File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,23 @@ export const getWorkspaces = async (
286
286
return response . data
287
287
}
288
288
289
+ // TODO change types
290
+ export const getWorkspacesCount = async (
291
+ options : TypesGen . AuditLogCountRequest = { }
292
+ ) : Promise < TypesGen . AuditLogCountResponse > => {
293
+ const searchParams = new URLSearchParams ( )
294
+ if ( options . q ) {
295
+ searchParams . set ( "q" , options . q )
296
+ }
297
+ // TODO
298
+ // const response = await axios.get(
299
+ // `/api/v2/workspaces/count?${searchParams.toString()}`,
300
+ // )
301
+ // return response.data
302
+
303
+ return Promise . resolve ( { count : 10 } )
304
+ }
305
+
289
306
export const getWorkspaceByOwnerAndName = async (
290
307
username = "me" ,
291
308
workspaceName : string ,
Original file line number Diff line number Diff line change @@ -387,7 +387,6 @@ createMachine(
387
387
} ,
388
388
assignUpdatedWorkspaceRefs : assign ( {
389
389
workspaceRefs : ( _ , event ) => {
390
-
391
390
const newWorkspaceRefs = event . data . newWorkspaces . map ( ( workspace ) =>
392
391
spawn (
393
392
workspaceItemMachine . withContext ( { data : workspace } ) ,
@@ -440,10 +439,9 @@ createMachine(
440
439
newWorkspaces,
441
440
} )
442
441
} ,
443
- getWorkspacesCount : ( ) => {
444
- //API.getWorkspacesCount()
445
- return Promise . resolve ( { count : 10 } )
446
- }
442
+ getWorkspacesCount : ( context ) => (
443
+ API . getWorkspacesCount ( { q : context . filter } )
444
+ )
447
445
} ,
448
446
} ,
449
447
)
You can’t perform that action at this time.
0 commit comments