summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/services/index.js
blob: 9546eb22c2721796b3c5af886933ebf560ab5db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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() {
    return axios.delete(this.endpoint);
  }

  updateIssuable(data) {
    return axios.put(this.endpoint, data);
  }
}