summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/deploy_keys/service/index.js
blob: 9dc3b21f6f6461db7f66f2f4a2f97c6d06d1d401 (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
import axios from '~/lib/utils/axios_utils';

export default class DeployKeysService {
  constructor(endpoint) {
    this.axios = axios.create({
      baseURL: endpoint,
    });
  }

  getKeys() {
    return this.axios.get()
      .then(response => response.data);
  }

  enableKey(id) {
    return this.axios.put(`${id}/enable`)
      .then(response => response.data);
  }

  disableKey(id) {
    return this.axios.put(`${id}/disable`)
      .then(response => response.data);
  }
}