properly deprovisions instance

This commit is contained in:
Alex Corey 2022-09-12 15:46:05 -04:00 committed by Jeff Bradberry
parent d4b25058cd
commit 6619cc39f7
3 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ class Instances extends Base {
}
deprovisionInstance(instanceId) {
return this.http.post(`${this.baseUrl}${instanceId}`, {
return this.http.patch(`${this.baseUrl}${instanceId}/`, {
node_state: 'deprovisioning',
});
}

View File

@ -110,7 +110,7 @@ function InstanceList() {
Promise.all(
selected.map(({ id }) => InstancesAPI.deprovisionInstance(id))
),
{ fetchItems: fetchInstances }
{ fetchItems: fetchInstances, qsConfig: QS_CONFIG }
);
return (

View File

@ -38,7 +38,7 @@ function RemoveInstanceButton({ itemsToRemove, onRemove, isK8s }) {
const toggleModal = async (isOpen) => {
setRemoveDetails(null);
setIsLoading(true);
if (isOpen && itemsToRemove.length === 1) {
if (isOpen && itemsToRemove.length > 0) {
const { results, error } = await getRelatedResourceDeleteCounts(
relatedResourceDeleteRequests.instance(itemsToRemove[0])
);
@ -85,7 +85,7 @@ function RemoveInstanceButton({ itemsToRemove, onRemove, isK8s }) {
<Plural
value={itemsToRemove.length}
one="This intance is currently being used by other resources. Are you sure you want to delete it?"
other="Deleting these instances could impact other resources that rely on them. Are you sure you want to delete anyway?"
other="Deprovisioning these instances could impact other resources that rely on them. Are you sure you want to delete anyway?"
/>
{removeDetails &&
Object.entries(removeDetails).map(([key, value]) => (