File tree 2 files changed +3
-4
lines changed
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default function Layout({ children }: LayoutProps) {
67
67
68
68
try {
69
69
const workspaces = await getWorkspaces ( ) ;
70
- const currentWorkspaces = ( workspaces as unknown as any [ ] ) . map ( ( workspace : any ) => workspace . name ) ;
70
+ const currentWorkspaces = workspaces . map ( ( workspace ) => workspace . name ) ;
71
71
if ( ! currentWorkspaces . includes ( workspaceName ) ) {
72
72
const newWorkspace = await createWorkspace ( {
73
73
workspaceName,
Original file line number Diff line number Diff line change 1
1
import SecurityClient from "~/utilities/SecurityClient" ;
2
2
3
- interface Workspaces {
3
+ interface Workspace {
4
4
__v : number ;
5
5
_id : string ;
6
6
name : string ;
7
7
organization : string ;
8
8
}
9
- [ ] ;
10
9
11
10
/**
12
11
* This route lets us get the workspaces of a certain user
@@ -20,7 +19,7 @@ const getWorkspaces = () => {
20
19
} ,
21
20
} ) . then ( async ( res ) => {
22
21
if ( res ?. status == 200 ) {
23
- const data = ( await res . json ( ) ) as unknown as { workspaces : Workspaces } ;
22
+ const data = ( await res . json ( ) ) as unknown as { workspaces : Workspace [ ] } ;
24
23
return data . workspaces ;
25
24
}
26
25
You can’t perform that action at this time.
0 commit comments