summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issues/show/services/index.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
commitaee0a117a889461ce8ced6fcf73207fe017f1d99 (patch)
tree891d9ef189227a8445d83f35c1b0fc99573f4380 /app/assets/javascripts/issues/show/services/index.js
parent8d46af3258650d305f53b819eabf7ab18d22f59e (diff)
downloadgitlab-ce-985a97665f0cffeefeeafdf55089c30e1832e6cf.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/issues/show/services/index.js')
-rw-r--r--app/assets/javascripts/issues/show/services/index.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/assets/javascripts/issues/show/services/index.js b/app/assets/javascripts/issues/show/services/index.js
new file mode 100644
index 00000000000..dba07f623f9
--- /dev/null
+++ b/app/assets/javascripts/issues/show/services/index.js
@@ -0,0 +1,29 @@
+import axios from '~/lib/utils/axios_utils';
+
+export default class Service {
+ constructor(endpoint) {
+ this.endpoint = `${endpoint}.json`;
+ this.realtimeEndpoint = `${endpoint}/realtime_changes`;
+ }
+
+ getData() {
+ return axios.get(this.realtimeEndpoint);
+ }
+
+ deleteIssuable(payload) {
+ return axios.delete(this.endpoint, { params: payload });
+ }
+
+ updateIssuable(data) {
+ return axios.put(this.endpoint, data);
+ }
+
+ // eslint-disable-next-line class-methods-use-this
+ loadTemplates(templateNamesEndpoint) {
+ if (!templateNamesEndpoint) {
+ return Promise.resolve([]);
+ }
+
+ return axios.get(templateNamesEndpoint);
+ }
+}