@@ -11,8 +11,7 @@ import {
1111 DropdownMenuSeparator ,
1212 DropdownMenuTrigger ,
1313} from '@/components/ui/dropdown-menu' ;
14- import { useGetWorkspace } from '@/features/workspaces/api/use-get-workspace' ;
15- import { useGetWorkspaces } from '@/features/workspaces/api/use-get-workspaces' ;
14+ import { useGetWorkspace , useGetWorkspaces } from '@/lib/backend' ;
1615import { useCreateWorkspaceModal } from '@/features/workspaces/store/use-create-workspace-modal' ;
1716import { useWorkspaceId } from '@/hooks/use-workspace-id' ;
1817
@@ -22,9 +21,9 @@ export const WorkspaceSwitcher = () => {
2221 const [ _open , setOpen ] = useCreateWorkspaceModal ( ) ;
2322
2423 const { data : workspaces , isLoading : workspacesLoading } = useGetWorkspaces ( ) ;
25- const { data : workspace , isLoading : workspaceLoading } = useGetWorkspace ( { id : workspaceId } ) ;
24+ const { data : workspace , isLoading : workspaceLoading } = useGetWorkspace ( workspaceId ) ;
2625
27- const filteredWorkspaces = workspaces ?. filter ( ( workspace ) => workspace ?. _id !== workspaceId ) ;
26+ const filteredWorkspaces = workspaces ?. filter ( ( workspace ) => workspace ?. id !== workspaceId ) ;
2827
2928 return (
3029 < DropdownMenu >
@@ -46,9 +45,9 @@ export const WorkspaceSwitcher = () => {
4645
4746 { filteredWorkspaces ?. map ( ( workspace ) => (
4847 < DropdownMenuItem
49- key = { workspace . _id }
48+ key = { workspace . id }
5049 className = "cursor-pointer overflow-hidden capitalize"
51- onClick = { ( ) => router . push ( `/workspace/${ workspace . _id } ` ) }
50+ onClick = { ( ) => router . push ( `/workspace/${ workspace . id } ` ) }
5251 >
5352 < div className = "relative mr-2 flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md bg-secondary text-xl font-semibold text-white" >
5453 { workspace . name . charAt ( 0 ) . toUpperCase ( ) }
0 commit comments