Skip to content

Commit

Permalink
prevent users from clicking save button again to create duplicate on …
Browse files Browse the repository at this point in the history
…attendee update page
  • Loading branch information
xjlin0 committed May 19, 2024
1 parent c86e8ce commit f4124bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions attendees/static/js/persons/attendee_update_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,8 @@ Attendees.datagridUpdate = {
submitAttendeeForm: (e, confirmMessage, extraHeaders) => {
const validationResults = Attendees.datagridUpdate.attendeeMainDxForm.validate();
if (validationResults.isValid && confirm(confirmMessage)) {
$('div.spinner-border').show();
e.component.option('disabled', true);
if (extraHeaders && extraHeaders['X-End-All-Attendee-Activities']) {
const deathdayEditor = Attendees.datagridUpdate.attendeeMainDxForm.getEditor("deathday");
if (!deathdayEditor.option('value')) {
Expand Down Expand Up @@ -1100,6 +1102,10 @@ Attendees.datagridUpdate = {
},
}, 'error', 5000);
},
complete: (response) => {
$('div.spinner-border').hide();
e.component.option('disabled', false);
},
});
} else if (!validationResults.isValid) {
validationMessages = validationResults.brokenRules.reduce((all, now) => {all.push(now.message); return all}, []);
Expand Down

0 comments on commit f4124bf

Please sign in to comment.