Skip to content

Commit

Permalink
Merge pull request #27899 from colemanw/afformSubmit
Browse files Browse the repository at this point in the history
Afform - Improve error handling during form submission
  • Loading branch information
colemanw authored Oct 25, 2023
2 parents 78a8654 + a1ea906 commit 333e10a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ext/afform/core/ang/af/afForm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
status,
args,
submissionResponse,
ts = CRM.ts('org.civicrm.afform'),
ctrl = this;

this.$onInit = function() {
Expand Down Expand Up @@ -112,7 +113,8 @@

$element.trigger('crmFormSuccess', {
afform: metaData,
data: data
data: data,
submissionResponse: submissionResponse,
});

status.resolve();
Expand Down Expand Up @@ -197,10 +199,9 @@
}
})
.catch(function(error) {
status.resolve();
status = CRM.status(error.error_message, 'error');
status.reject();
$element.unblock();
CRM.alert(error.error_message, ts('Form Error'));
CRM.alert(error.error_message || '', ts('Form Error'));
});
};
}
Expand Down

0 comments on commit 333e10a

Please sign in to comment.