Skip to content

Commit 476ab61

Browse files
fixing parameters for patch
1 parent edd9e76 commit 476ab61

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/components/ControlPlane/ManagedResources.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
DeleteManagedResourceType,
2828
DeleteMCPManagedResource,
2929
PatchResourceForForceDeletion,
30+
PatchResourceForForceDeletionBody,
3031
} from '../../lib/api/types/crate/deleteResource';
3132
import { useResourcePluralNames } from '../../hooks/useResourcePluralNames';
3233

@@ -76,7 +77,7 @@ export function ManagedResources() {
7677
DeleteMCPManagedResource(apiVersion, pluralKind, resourceName, namespace),
7778
);
7879

79-
const { trigger: patchTrigger } = useApiResourceMutation<undefined>(
80+
const { trigger: patchTrigger } = useApiResourceMutation<DeleteManagedResourceType>(
8081
PatchResourceForForceDeletion(apiVersion, pluralKind, resourceName, namespace),
8182
);
8283

@@ -188,13 +189,16 @@ export function ManagedResources() {
188189
toast.show(t('ManagedResources.deleteStarted', { resourceName: item.metadata.name }));
189190

190191
try {
191-
await deleteTrigger();
192192

193+
await deleteTrigger();
194+
193195
if (force) {
194-
await patchTrigger();
196+
await patchTrigger(PatchResourceForForceDeletionBody);
195197
}
196198
} catch (_) {
197199
// Ignore errors - will be handled by the mutation hook
200+
} finally {
201+
setPendingDeleteItem(null);
198202
}
199203
};
200204

@@ -241,7 +245,7 @@ export function ManagedResources() {
241245
<ManagedResourceDeleteDialog
242246
open={!!pendingDeleteItem}
243247
item={pendingDeleteItem}
244-
onClose={() => setPendingDeleteItem(null)}
248+
onClose={() => {}}
245249
onDeletionConfirmed={handleDeletionConfirmed}
246250
/>
247251
</>

src/lib/api/types/crate/deleteResource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const PatchResourceForForceDeletion = (
2828
path: path,
2929
method: 'PATCH',
3030
jq: undefined,
31-
body: JSON.stringify(PatchResourceForForceDeletionBody),
31+
body: undefined,
3232
};
3333
};
3434

0 commit comments

Comments
 (0)