Handle attendee conflicts in the Web interface

See @d7b010
This commit is contained in:
Francis Lachapelle
2016-02-15 15:58:58 -05:00
parent f2ffb52318
commit d56d9f8b08
9 changed files with 176 additions and 21 deletions
@@ -162,6 +162,7 @@
vm.addAttachUrl = addAttachUrl;
vm.cancel = cancel;
vm.save = save;
vm.attendeeConflictError = false;
vm.attendeesEditor = {
days: getDays(),
hours: getHours()
@@ -217,15 +218,18 @@
}
}
function save(form) {
function save(form, options) {
if (form.$valid) {
vm.component.$save()
vm.component.$save(options)
.then(function(data) {
$rootScope.$emit('calendars:list');
$mdDialog.hide();
Alarm.getAlarms();
}, function(data, status) {
$log.debug('failed');
}, function(response) {
if (response.status == 403 &&
response.data && response.data.message && angular.isObject(response.data.message)) {
vm.attendeeConflictError = response.data.message;
}
});
}
}