未验证 提交 85e0bf39 编写于 作者: P Phil Hughes

Converted project_label_subscription.js to use axios

上级 9f553730
import { __ } from './locale';
import axios from './lib/utils/axios_utils';
import flash from './flash';
export default class ProjectLabelSubscription {
constructor(container) {
this.$container = $(container);
......@@ -17,10 +21,7 @@ export default class ProjectLabelSubscription {
$btn.addClass('disabled');
$span.toggleClass('hidden');
$.ajax({
type: 'POST',
url,
}).done(() => {
axios.post(url).then(() => {
let newStatus;
let newAction;
......@@ -45,6 +46,6 @@ export default class ProjectLabelSubscription {
return button;
});
});
}).catch(() => flash(__('There was an error subscribing to this label.')));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册