fix(calendar(js)): prevent duplicate event creation in case of an event conflict

In case of an calendar event conflict the form submit button was not
disabled after use, allowing it to be clicked again.
This could have resulted in a double creation of the submit event.
This commit is contained in:
Leon Klingele authored and Leon Klingele committed 2023-05-10 17:13:23 +02:00
1 parent a5d4715e76
commit f04c73d495
2 files changed
+16 -7

No files matched your search

@@ -547,10 +547,13 @@
$mdDialog.cancel = vm.originalModalCancel;
$mdDialog.hide();
}, function(response) {
if (response.status == CalendarSettings.ConflictHTTPErrorCode)
vm.allowResubmit(form);
if (response.status == CalendarSettings.ConflictHTTPErrorCode) {
vm.attendeeConflictError = _.isObject(response.data.message) ? response.data.message : { reject: response.data.message };
else
} else {
vm.edit(form);
}
});
}
});
@@ -584,6 +587,11 @@
form.$setDirty();
};
this.allowResubmit = function (form) {
form.$setPristine();
form.$setDirty();
};
function getHours() {
var hours = [];
for (var i = 0; i <= 23; i++) {