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

30 lines
659 B
JavaScript
Raw Normal View History

2022-01-26 12:08:38 +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
}
2019-12-04 20:38:33 +05:30
deleteIssuable(payload) {
return axios.delete(this.endpoint, { params: payload });
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
}
2019-12-21 20:55:43 +05:30
// eslint-disable-next-line class-methods-use-this
loadTemplates(templateNamesEndpoint) {
if (!templateNamesEndpoint) {
return Promise.resolve([]);
}
return axios.get(templateNamesEndpoint);
}
2017-08-17 22:00:37 +05:30
}