summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/deploy_keys/service/index.js
blob: 268a37008c57ad009d9ee0e1f2057f23622e0347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
  }
}