FIX: displayErrors is undefined in flags.js controller

This commit is contained in:
Neil Lalonde 2014-05-21 12:19:27 -04:00
parent 68747c8d2d
commit 7061f6a570
1 changed files with 6 additions and 2 deletions

View File

@ -90,8 +90,12 @@ export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
postAction.act(params).then(function() { postAction.act(params).then(function() {
self.send('closeModal'); self.send('closeModal');
}, function(errors) { }, function(errors) {
self.send('showModal'); self.send('closeModal');
self.displayErrors(errors); if (errors && errors.responseText) {
bootbox.alert($.parseJSON(errors.responseText).errors);
} else {
bootbox.alert(I18n.t('generic_error'));
}
}); });
}, },