debian-mirror-gitlab/app/assets/javascripts/issue_show/services/index.js

30 lines
553 B
JavaScript
Raw Normal View History

2017-09-10 17:25:29 +05:30
import Vue from 'vue';
import VueResource from 'vue-resource';
Vue.use(VueResource);
2017-08-17 22:00:37 +05:30
export default class Service {
2017-09-10 17:25:29 +05:30
constructor(endpoint) {
2017-08-17 22:00:37 +05:30
this.endpoint = endpoint;
2017-09-10 17:25:29 +05:30
this.resource = Vue.resource(`${this.endpoint}.json`, {}, {
realtimeChanges: {
method: 'GET',
url: `${this.endpoint}/realtime_changes`,
},
});
}
getData() {
return this.resource.realtimeChanges();
}
deleteIssuable() {
return this.resource.delete();
2017-08-17 22:00:37 +05:30
}
2017-09-10 17:25:29 +05:30
updateIssuable(data) {
return this.resource.update(data);
2017-08-17 22:00:37 +05:30
}
}