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

21 lines
416 B
JavaScript
Raw Normal View History

2017-12-14 23:52:18 -05:00
import axios from '../../lib/utils/axios_utils';
2017-04-05 21:13:06 -04:00
export default class Service {
constructor(endpoint) {
2017-12-14 23:52:18 -05:00
this.endpoint = `${endpoint}.json`;
this.realtimeEndpoint = `${endpoint}/realtime_changes`;
2017-04-05 21:13:06 -04:00
}
getData() {
2017-12-14 23:52:18 -05:00
return axios.get(this.realtimeEndpoint);
}
deleteIssuable() {
2017-12-14 23:52:18 -05:00
return axios.delete(this.endpoint);
}
updateIssuable(data) {
2017-12-14 23:52:18 -05:00
return axios.put(this.endpoint, data);
2017-04-05 21:13:06 -04:00
}
}