Skip to content

Commit 3b4343d

Browse files
authored
fix: fix workspace creation on template page (coder#17518)
1 parent 5a7d531 commit 3b4343d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

site/src/pages/TemplatePage/TemplateLayout.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,14 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
8585
queryFn: () => fetchTemplate(organizationName, templateName),
8686
});
8787
const workspacePermissionsQuery = useQuery(
88-
checkAuthorization({
89-
checks: workspacePermissionChecks(organizationName, me.id),
90-
}),
88+
data
89+
? checkAuthorization({
90+
checks: workspacePermissionChecks(
91+
data.template.organization_id,
92+
me.id,
93+
),
94+
})
95+
: { enabled: false },
9196
);
9297

9398
const location = useLocation();

0 commit comments

Comments
 (0)