2018-03-17 18:26:18 +05:30
|
|
|
import axios from '../../lib/utils/axios_utils';
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
export default class Service {
|
2017-09-10 17:25:29 +05:30
|
|
|
constructor(endpoint) {
|
2018-03-17 18:26:18 +05:30
|
|
|
this.endpoint = `${endpoint}.json`;
|
|
|
|
this.realtimeEndpoint = `${endpoint}/realtime_changes`;
|
2017-09-10 17:25:29 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
getData() {
|
2018-03-17 18:26:18 +05:30
|
|
|
return axios.get(this.realtimeEndpoint);
|
2017-09-10 17:25:29 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
deleteIssuable() {
|
2018-03-17 18:26:18 +05:30
|
|
|
return axios.delete(this.endpoint);
|
2017-08-17 22:00:37 +05:30
|
|
|
}
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
updateIssuable(data) {
|
2018-03-17 18:26:18 +05:30
|
|
|
return axios.put(this.endpoint, data);
|
2017-08-17 22:00:37 +05:30
|
|
|
}
|
|
|
|
}
|