Fixed error handling

This commit is contained in:
2026-09-27 14:35:52 +02:00
parent 9ba48de55b
commit 0d626fd84a
5 changed files with 214 additions and 90 deletions
@@ -163,7 +163,7 @@ export const BeneficiariesPage: React.FC = () => {
benForm.reset();
success('Beneficiary Registered', 'New project beneficiary profile successfully created.');
},
onError: (err: any) => toastError('Registration Failed', err.message || 'Unable to save beneficiary.'),
onError: (err: any) => toastError('Registration Failed', err),
});
const updateBenMutation = useMutation({
@@ -185,7 +185,7 @@ export const BeneficiariesPage: React.FC = () => {
benForm.reset();
success('Beneficiary Updated', 'Beneficiary details and targets updated.');
},
onError: (err: any) => toastError('Update Failed', err.message || 'Unable to update beneficiary.'),
onError: (err: any) => toastError('Update Failed', err),
});
const createCompMutation = useMutation({
@@ -199,7 +199,7 @@ export const BeneficiariesPage: React.FC = () => {
compForm.reset();
success('Compliance Requirement Logged', 'Compliance item registered for project beneficiaries.');
},
onError: (err: any) => toastError('Creation Failed', err.message || 'Unable to record compliance item.'),
onError: (err: any) => toastError('Creation Failed', err),
});
const updateCompMutation = useMutation({
@@ -219,7 +219,7 @@ export const BeneficiariesPage: React.FC = () => {
compForm.reset();
success('Compliance Item Updated', 'Status and requirement record updated.');
},
onError: (err: any) => toastError('Update Failed', err.message || 'Unable to update compliance item.'),
onError: (err: any) => toastError('Update Failed', err),
});
const createOutcomeMutation = useMutation({
@@ -233,7 +233,7 @@ export const BeneficiariesPage: React.FC = () => {
outcomeForm.reset();
success('Outcome Logged', 'Beneficiary outcome and impact metric registered.');
},
onError: (err: any) => toastError('Failed to Record Outcome', err.message || 'Unable to save outcome.'),
onError: (err: any) => toastError('Failed to Record Outcome', err),
});
// Filtered & Sorted Beneficiaries