Skip to content

Commit 2dffee6

Browse files
committed
fix
1 parent c2b3815 commit 2dffee6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/lib/api/types/crossplane/CRDList.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ export type CRDResponse = {
4040
export const CRDRequest: Resource<CRDResponse> = {
4141
path: '/apis/apiextensions.k8s.io/v1/customresourcedefinitions',
4242
};
43+
44+
export const CRDRequestAuthCheck: Resource<CRDResponse> = {
45+
path: '/apis/apiextensions.k8s.io/v1/customresourcedefinitions',
46+
jq: '{kind: .kind}',
47+
};

src/spaces/mcp/authorization/ManagedControlPlaneAuthorization.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { generatePath, useNavigate, useParams } from 'react-router-dom';
88
import { Routes } from '../../../Routes.ts';
99

1010
import { Center } from '../../../components/Ui/Center/Center.tsx';
11-
import { CRDRequest } from '../../../lib/api/types/crossplane/CRDList.ts';
11+
import { CRDRequestAuthCheck } from '../../../lib/api/types/crossplane/CRDList.ts';
1212
import { useApiResource } from '../../../lib/api/useApiResource.ts';
1313

1414
export interface ManagedControlPlaneAuthorizationProps {
@@ -30,7 +30,7 @@ export const ManagedControlPlaneAuthorization = ({ children }: ManagedControlPla
3030
};
3131

3232
// Check if user has access to CRDs in the MCP's cluster
33-
const { error, isLoading } = useApiResource(CRDRequest);
33+
const { error, isLoading } = useApiResource(CRDRequestAuthCheck);
3434
if (isLoading) {
3535
return (
3636
<Center>

0 commit comments

Comments
 (0)