gitlab-org--gitlab-foss/app/assets/javascripts/issue_show/services/index.js

30 lines
553 B
JavaScript
Raw Normal View History

import Vue from 'vue';
import VueResource from 'vue-resource';
Vue.use(VueResource);
2017-04-05 21:13:06 -04:00
export default class Service {
constructor(endpoint) {
2017-04-05 21:13:06 -04:00
this.endpoint = endpoint;
this.resource = Vue.resource(`${this.endpoint}.json`, {}, {
realtimeChanges: {
method: 'GET',
url: `${this.endpoint}/realtime_changes`,
},
});
2017-04-05 21:13:06 -04:00
}
getData() {
return this.resource.realtimeChanges();
}
deleteIssuable() {
return this.resource.delete();
}
updateIssuable(data) {
return this.resource.update(data);
2017-04-05 21:13:06 -04:00
}
}