Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dab430f0
Commit
dab430f0
authored
Jan 29, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted group_label_subscription to axios
parent
a491bcc2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
app/assets/javascripts/group_label_subscription.js
app/assets/javascripts/group_label_subscription.js
+13
-14
No files found.
app/assets/javascripts/group_label_subscription.js
View file @
dab430f0
import
axios
from
'
./lib/utils/axios_utils
'
;
import
flash
from
'
./flash
'
;
import
{
__
}
from
'
./locale
'
;
export
default
class
GroupLabelSubscription
{
constructor
(
container
)
{
const
$container
=
$
(
container
);
...
...
@@ -13,14 +17,12 @@ export default class GroupLabelSubscription {
event
.
preventDefault
();
const
url
=
this
.
$unsubscribeButtons
.
attr
(
'
data-url
'
);
$
.
ajax
({
type
:
'
POST
'
,
url
,
}).
done
(()
=>
{
axios
.
post
(
url
)
.
then
(()
=>
{
this
.
toggleSubscriptionButtons
();
this
.
$unsubscribeButtons
.
removeAttr
(
'
data-url
'
);
});
})
.
catch
(()
=>
flash
(
__
(
'
There was an error when unsubscribing from this label.
'
)));
}
subscribe
(
event
)
{
...
...
@@ -31,12 +33,9 @@ export default class GroupLabelSubscription {
this
.
$unsubscribeButtons
.
attr
(
'
data-url
'
,
url
);
$
.
ajax
({
type
:
'
POST
'
,
url
,
}).
done
(()
=>
{
this
.
toggleSubscriptionButtons
();
});
axios
.
post
(
url
)
.
then
(()
=>
this
.
toggleSubscriptionButtons
())
.
catch
(()
=>
flash
(
__
(
'
There was an error when subscribing to this label.
'
)));
}
toggleSubscriptionButtons
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment