@@ -6,7 +6,6 @@ import { Loader } from "components/Loader/Loader";
66import { Margins } from "components/Margins/Margins" ;
77import { TabLink , Tabs , TabsList } from "components/Tabs/Tabs" ;
88import { useAuthenticated } from "contexts/auth/RequireAuth" ;
9- import { useDashboard } from "modules/dashboard/useDashboard" ;
109import { workspacePermissionChecks } from "modules/permissions/workspaces" ;
1110import {
1211type FC ,
@@ -78,18 +77,15 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
7877const { user :me } = useAuthenticated ( ) ;
7978const { organization :organizationName = "default" , template :templateName } =
8079useParams ( ) as { organization ?:string ; template :string } ;
81- const { organizations} = useDashboard ( ) ;
82- const organization = organizations . find ( ( o ) => o . name === organizationName ) ;
8380const { data, error, isLoading} = useQuery ( {
8481queryKey :[ "template" , templateName ] ,
8582queryFn :( ) => fetchTemplate ( organizationName , templateName ) ,
8683} ) ;
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 ) ,
9087} ) ,
91- enabled :organization !== undefined ,
92- } ) ;
88+ ) ;
9389
9490const location = useLocation ( ) ;
9591const paths = location . pathname . split ( "/" ) ;