2017-12-14 23:52:18 -05:00
|
|
|
import axios from '../../lib/utils/axios_utils';
|
2017-05-10 07:29:33 -04:00
|
|
|
|
2017-04-05 21:13:06 -04:00
|
|
|
export default class Service {
|
2017-05-10 07:29:33 -04:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2017-05-10 07:29:33 -04:00
|
|
|
getData() {
|
2017-12-14 23:52:18 -05:00
|
|
|
return axios.get(this.realtimeEndpoint);
|
2017-05-12 06:23:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
deleteIssuable() {
|
2017-12-14 23:52:18 -05:00
|
|
|
return axios.delete(this.endpoint);
|
2017-05-12 06:23:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
updateIssuable(data) {
|
2017-12-14 23:52:18 -05:00
|
|
|
return axios.put(this.endpoint, data);
|
2017-04-05 21:13:06 -04:00
|
|
|
}
|
|
|
|
}
|