Merge pull request #17 from tgxworld/use_popupajaxerror
Use popupAjaxError.
This commit is contained in:
commit
133a3b7168
|
@ -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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue