mirror of
https://github.com/flarum/core.git
synced 2025-07-29 20:50:28 +02:00
Better handling of AJAX errors
This commit is contained in:
@@ -88,11 +88,14 @@ export default Ember.ObjectController.extend(Ember.Evented, {
|
||||
}
|
||||
},
|
||||
function(reason) {
|
||||
var message = AlertMessage.create({
|
||||
type: 'warning',
|
||||
message: reason.errors[0].detail
|
||||
});
|
||||
controller.get('controllers.application').send('alert', message);
|
||||
var errors = reason.errors;
|
||||
for (var i in reason.errors) {
|
||||
var message = AlertMessage.create({
|
||||
type: 'warning',
|
||||
message: reason.errors[i]
|
||||
});
|
||||
controller.get('controllers.application').send('alert', message);
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
composer.set('content.loading', false);
|
||||
|
Reference in New Issue
Block a user