feat: uncategorize transaciton catch validation errors

This commit is contained in:
Ahmed Bouhuolia
2024-03-10 03:08:24 +02:00
parent b71c79fef5
commit 2c98376162
3 changed files with 36 additions and 17 deletions

View File

@@ -56,7 +56,21 @@ function AccountDeleteTransactionAlert({
response: {
data: { errors },
},
}) => {},
}) => {
if (
errors.find(
(e) =>
e.type ===
'CANNOT_DELETE_TRANSACTION_CONVERTED_FROM_UNCATEGORIZED',
)
) {
AppToaster.show({
message:
'Cannot delete transaction converted from uncategorized transaction but you uncategorize it.',
intent: Intent.DANGER,
});
}
},
)
.finally(() => {
closeAlert(name);