Merge pull request #17 from tgxworld/use_popupajaxerror

Use popupAjaxError.
This commit is contained in:
Robin Ward 2015-08-24 11:06:31 -04:00
commit 133a3b7168
1 changed files with 3 additions and 22 deletions

View File

@ -5,6 +5,7 @@ import Topic from 'discourse/models/topic';
import User from 'discourse/models/user'; import User from 'discourse/models/user';
import TopicStatus from 'discourse/views/topic-status'; import TopicStatus from 'discourse/views/topic-status';
import computed from 'ember-addons/ember-computed-decorators'; import computed from 'ember-addons/ember-computed-decorators';
import { popupAjaxError } from 'discourse/lib/ajax-error';
export default { export default {
name: 'extend-for-solved-button', name: 'extend-for-solved-button',
@ -113,17 +114,7 @@ export default {
data: { data: {
id: this.get('post.id') id: this.get('post.id')
} }
}).then(function(){ }).catch(popupAjaxError);
//
}).catch(function(error){
var message = I18n.t("generic_error");
try {
message = $.parseJSON(error.responseText).errors;
} catch (e) {
// nothing we can do
}
bootbox.alert(message);
});
}, },
clearAcceptedAnswer: function(){ clearAcceptedAnswer: function(){
@ -155,17 +146,7 @@ export default {
data: { data: {
id: this.get('post.id') id: this.get('post.id')
} }
}).then(function(){ }).catch(popupAjaxError);
//
}).catch(function(error){
var message = I18n.t("generic_error");
try {
message = $.parseJSON(error.responseText).errors;
} catch (e) {
// nothing we can do
}
bootbox.alert(message);
});
} }
}); });
} }