summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-02-02 10:38:31 +0000
committerPhil Hughes <me@iamphill.com>2018-02-05 09:40:57 +0000
commit85e0bf39ced8659385aea9bbee94a9d21c5f6a70 (patch)
tree774ad651ccb6a4bcc82938d0a846c4d0c0fc229c
parent9f5537304bf30bbe7430cc0290df3acea035a428 (diff)
downloadgitlab-ce-85e0bf39ced8659385aea9bbee94a9d21c5f6a70.tar.gz
Converted project_label_subscription.js to use axios
-rw-r--r--app/assets/javascripts/project_label_subscription.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/project_label_subscription.js b/app/assets/javascripts/project_label_subscription.js
index b65521b278f..64b7dd540f9 100644
--- a/app/assets/javascripts/project_label_subscription.js
+++ b/app/assets/javascripts/project_label_subscription.js
@@ -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.')));
}
}