Skip to content

Commit 3bed46c

Browse files
committed
fix
1 parent 61f39f4 commit 3bed46c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/Wizards/CreateManagedControlPlane/EditManagedControlPlaneWizardDataLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const EditManagedControlPlaneWizardDataLoader: FC<EditManagedControlPlane
3232
const { isLoading, data, error } = useApiResource(
3333
ResourceObject<ManagedControlPlaneInterface>(workspaceName ?? '', 'managedcontrolplanes', resourceName),
3434
undefined,
35-
true,
35+
null,
3636
!isOpen,
3737
);
3838

src/hooks/useComponentsQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface GetComponentsHookResult {
88
isLoading: boolean;
99
}
1010
export function useComponentsQuery(): GetComponentsHookResult {
11-
const { data: components, error, isLoading } = useApiResource(ListManagedComponents(), undefined, {});
11+
const { data: components, error, isLoading } = useApiResource(ListManagedComponents(), undefined, null);
1212

1313
return { components, error, isLoading };
1414
}

src/lib/api/useApiResource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ProviderConfigs, ProviderConfigsData, ProviderConfigsDataForRequest } f
1313
export const useApiResource = <T>(
1414
resource: Resource<T>,
1515
config?: SWRConfiguration,
16-
overrideMcpConfig?: ApiConfig['mcpConfig'],
16+
overrideMcpConfig?: ApiConfig['mcpConfig'] | null,
1717
disable?: boolean,
1818
) => {
1919
const apiConfig = useContext(ApiConfigContext);
@@ -23,9 +23,9 @@ export const useApiResource = <T>(
2323
([path, apiConfig, overrideMcpConfig]) =>
2424
fetchApiServerJson<T>(
2525
path,
26-
overrideMcpConfig
27-
? { ...apiConfig, mcpConfig: overrideMcpConfig.projectName ? overrideMcpConfig : undefined }
28-
: apiConfig,
26+
overrideMcpConfig === undefined
27+
? apiConfig
28+
: { ...apiConfig, mcpConfig: overrideMcpConfig === null ? undefined : overrideMcpConfig },
2929
resource.jq,
3030
resource.method,
3131
resource.body,

0 commit comments

Comments
 (0)