Skip to content

Commit 1bfd036

Browse files
committed
fix: prevent orphaned functions by validating full-deployment deletion in table
1 parent 1bc9508 commit 1bfd036

File tree

1 file changed

+3
-8
lines changed
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]

1 file changed

+3
-8
lines changed

src/routes/(console)/project-[region]-[project]/functions/function-[function]/table.svelte

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
trackError(error, Submit.DeploymentDelete);
8080
return error;
8181
}
82-
83-
const warning = new Error(
84-
'Deleting all deployments will leave this function without any deployments. Consider keeping at least one deployment or delete the function instead.'
85-
);
86-
trackError(warning, Submit.DeploymentDelete);
87-
return warning;
8882
}
8983
9084
const promises = selectedRows.map((deploymentId) =>
@@ -97,9 +91,10 @@
9791
try {
9892
await Promise.all(promises);
9993
trackEvent(Submit.DeploymentDelete);
94+
return undefined;
10095
} catch (error) {
101-
trackError(error, Submit.DeploymentDelete);
102-
return error;
96+
trackError(error as Error, Submit.DeploymentDelete);
97+
return error as Error;
10398
} finally {
10499
await invalidate(Dependencies.DEPLOYMENTS);
105100
}

0 commit comments

Comments
 (0)