Converted project_label_subscription.js to use axios

This commit is contained in:
Phil Hughes 2018-02-02 10:38:31 +00:00
parent 9f5537304b
commit 85e0bf39ce
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
1 changed files with 6 additions and 5 deletions

View File

@ -1,3 +1,7 @@
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.')));
}
}