Skip to content

Commit d1f7eb0

Browse files
committed
Revert "fix: get org id for permission check on template layout"
This reverts commit 0b13269.
1 parent 0b13269 commit d1f7eb0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

site/src/pages/TemplatePage/TemplateLayout.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Loader } from "components/Loader/Loader";
66
import { Margins } from "components/Margins/Margins";
77
import { TabLink, Tabs, TabsList } from "components/Tabs/Tabs";
88
import { useAuthenticated } from "contexts/auth/RequireAuth";
9-
import { useDashboard } from "modules/dashboard/useDashboard";
109
import { workspacePermissionChecks } from "modules/permissions/workspaces";
1110
import {
1211
type FC,
@@ -78,18 +77,15 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
7877
const { user: me } = useAuthenticated();
7978
const { organization: organizationName = "default", template: templateName } =
8079
useParams() as { organization?: string; template: string };
81-
const { organizations } = useDashboard();
82-
const organization = organizations.find((o) => o.name === organizationName);
8380
const { data, error, isLoading } = useQuery({
8481
queryKey: ["template", templateName],
8582
queryFn: () => 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

9490
const location = useLocation();
9591
const paths = location.pathname.split("/");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy