@@ -6,7 +6,6 @@ import { Loader } from "components/Loader/Loader";
6
6
import { Margins } from "components/Margins/Margins" ;
7
7
import { TabLink , Tabs , TabsList } from "components/Tabs/Tabs" ;
8
8
import { useAuthenticated } from "contexts/auth/RequireAuth" ;
9
- import { useDashboard } from "modules/dashboard/useDashboard" ;
10
9
import { workspacePermissionChecks } from "modules/permissions/workspaces" ;
11
10
import {
12
11
type FC ,
@@ -78,18 +77,15 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
78
77
const { user :me } = useAuthenticated ( ) ;
79
78
const { organization :organizationName = "default" , template :templateName } =
80
79
useParams ( ) as { organization ?:string ; template :string } ;
81
- const { organizations} = useDashboard ( ) ;
82
- const organization = organizations . find ( ( o ) => o . name === organizationName ) ;
83
80
const { data, error, isLoading} = useQuery ( {
84
81
queryKey :[ "template" , templateName ] ,
85
82
queryFn :( ) => fetchTemplate ( organizationName , templateName ) ,
86
83
} ) ;
87
- const workspacePermissionsQuery = useQuery ( {
88
- ... checkAuthorization ( {
89
- checks :workspacePermissionChecks ( organization ?. id ?? "" , me . id ) ,
84
+ const workspacePermissionsQuery = useQuery (
85
+ checkAuthorization ( {
86
+ checks :workspacePermissionChecks ( organizationName , me . id ) ,
90
87
} ) ,
91
- enabled :organization !== undefined ,
92
- } ) ;
88
+ ) ;
93
89
94
90
const location = useLocation ( ) ;
95
91
const paths = location . pathname . split ( "/" ) ;