mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-22 02:28:29 +00:00
refactor: streamline error handling and notification logic across various components
This commit is contained in:
+9
-16
@@ -39,22 +39,15 @@ export const PmtMethodsTable = () => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await deleteOrgPmtMethod.mutateAsync({
|
||||
organizationId: currentOrg.id,
|
||||
pmtMethodId: pmtMethodToRemove.id
|
||||
});
|
||||
createNotification({
|
||||
type: "success",
|
||||
text: "Successfully removed payment method"
|
||||
});
|
||||
handlePopUpClose("removeCard");
|
||||
} catch (error: any) {
|
||||
createNotification({
|
||||
type: "error",
|
||||
text: error.message ?? "Error removing payment method"
|
||||
});
|
||||
}
|
||||
await deleteOrgPmtMethod.mutateAsync({
|
||||
organizationId: currentOrg.id,
|
||||
pmtMethodId: pmtMethodToRemove.id
|
||||
});
|
||||
createNotification({
|
||||
type: "success",
|
||||
text: "Successfully removed payment method"
|
||||
});
|
||||
handlePopUpClose("removeCard");
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user