Fixed error handling
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -235,7 +235,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
issueForm.reset();
|
||||
success('Issue Logged', 'New project issue created and assigned.');
|
||||
},
|
||||
onError: (err: any) => toastError('Creation Failed', err.message || 'Unable to log issue.'),
|
||||
onError: (err: any) => toastError('Creation Failed', err),
|
||||
});
|
||||
|
||||
const updateIssueMutation = useMutation({
|
||||
@@ -270,7 +270,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
editIssueForm.reset();
|
||||
success('Issue Updated', 'Issue record and resolution status saved successfully.');
|
||||
},
|
||||
onError: (err: any) => toastError('Update Failed', err.message || 'Unable to update issue.'),
|
||||
onError: (err: any) => toastError('Update Failed', err),
|
||||
});
|
||||
|
||||
const resolveIssueMutation = useMutation({
|
||||
@@ -294,7 +294,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
resolveIssueForm.reset();
|
||||
success('Issue Resolved', 'Resolution recorded and issue status updated.');
|
||||
},
|
||||
onError: (err: any) => toastError('Resolution Failed', err.message || 'Unable to resolve issue.'),
|
||||
onError: (err: any) => toastError('Resolution Failed', err),
|
||||
});
|
||||
|
||||
const createChangeMutation = useMutation({
|
||||
@@ -314,7 +314,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
changeForm.reset();
|
||||
success('Change Request Submitted', 'Formal change request submitted for review.');
|
||||
},
|
||||
onError: (err: any) => toastError('Submission Failed', err.message || 'Unable to submit change request.'),
|
||||
onError: (err: any) => toastError('Submission Failed', err),
|
||||
});
|
||||
|
||||
const resolveChangeMutation = useMutation({
|
||||
@@ -335,7 +335,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
resolveChangeForm.reset();
|
||||
success('Change Decision Applied', 'Change request decision successfully resolved.');
|
||||
},
|
||||
onError: (err: any) => toastError('Decision Failed', err.message || 'Unable to resolve change request.'),
|
||||
onError: (err: any) => toastError('Decision Failed', err),
|
||||
});
|
||||
|
||||
const updateChangeMutation = useMutation({
|
||||
@@ -356,7 +356,7 @@ export const ChangeManagementPage: React.FC = () => {
|
||||
editChangeForm.reset();
|
||||
success('Change Request Updated', 'Change proposal and governance status saved.');
|
||||
},
|
||||
onError: (err: any) => toastError('Update Failed', err.message || 'Unable to update change request.'),
|
||||
onError: (err: any) => toastError('Update Failed', err),
|
||||
});
|
||||
|
||||
// Filtered & Sorted Issues
|
||||
|
||||
@@ -111,7 +111,7 @@ export const SiteVisitsPage: React.FC = () => {
|
||||
visitForm.reset();
|
||||
success('Site Visit Logged', 'Field inspection recorded with inspector findings.');
|
||||
},
|
||||
onError: (err: any) => toastError('Logging Failed', err.message || 'Unable to save site visit.'),
|
||||
onError: (err: any) => toastError('Logging Failed', err),
|
||||
});
|
||||
|
||||
const updateVisitMutation = useMutation({
|
||||
@@ -132,7 +132,7 @@ export const SiteVisitsPage: React.FC = () => {
|
||||
visitForm.reset();
|
||||
success('Site Visit Updated', 'Inspection report and verification status updated.');
|
||||
},
|
||||
onError: (err: any) => toastError('Update Failed', err.message || 'Unable to update site visit.'),
|
||||
onError: (err: any) => toastError('Update Failed', err),
|
||||
});
|
||||
|
||||
// Filtered & Sorted Visits
|
||||
|
||||
Reference in New Issue
Block a user