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
8ad6efc9
Commit
8ad6efc9
authored
Dec 14, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes to subbable resource logic.
parent
0dfa9334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
app/assets/javascripts/subbable_resource.js.es6
app/assets/javascripts/subbable_resource.js.es6
+11
-12
No files found.
app/assets/javascripts/subbable_resource.js.es6
View file @
8ad6efc9
(() => {
/*
* SubbableResource can be extended to provide a pubsub-style service for one-off REST
* SubbableResource can be extended to provide a pubsub-style service for one-off REST
* calls. Subscribe by passing a callback or render method you will use to handle responses.
*
* TODO: Provide support for matchers
*
* */
class SubbableResource {
constructor(resourcePath) {
this.endpoint = resourcePath;
// TODO: Switch to axios.create asap
this.resource = Vue.resource(resourcePath);
// TODO: Switch to axios.create
this.resource = $.ajax;
this.subscribers = [];
}
...
...
@@ -28,22 +27,22 @@
}
get(payload) {
return this.resource
.get
(payload)
return this.resource(payload)
.then(data => this.publish(data));
}
save
(payload) {
return this.resource
.save
(payload)
post
(payload) {
return this.resource(payload)
.then(data => this.publish(data));
}
update
(payload) {
return this.resource
.update
(payload)
put
(payload) {
return this.resource(payload)
.then(data => this.publish(data));
}
remov
e(payload) {
return this.resource
.remove
(payload)
delet
e(payload) {
return this.resource(payload)
.then(data => this.publish(data));
}
}
...
...
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