mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 18:29:28 +00:00
Prevent users from deleting the last payment method attached to the org
This commit is contained in:
+7
@@ -32,6 +32,13 @@ export const PmtMethodsTable = () => {
|
||||
|
||||
const handleDeletePmtMethodBtnClick = async () => {
|
||||
if (!currentOrg?.id || !pmtMethodToRemove) return;
|
||||
if (data?.length === 1) {
|
||||
createNotification({
|
||||
type: "error",
|
||||
text: "You must have at least one payment method"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await deleteOrgPmtMethod.mutateAsync({
|
||||
organizationId: currentOrg.id,
|
||||
|
||||
Reference in New Issue
Block a user