Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « services « issue_show « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b1deeaae0fcda54327ab6b8aeb9ed99a76c50ef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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);
  }
}