debian-mirror-gitlab/app/assets/javascripts/deploy_keys/service/index.js
2021-03-08 18:12:59 +05:30

19 lines
465 B
JavaScript

import axios from '~/lib/utils/axios_utils';
export default class DeployKeysService {
constructor(endpoint) {
this.endpoint = endpoint;
}
getKeys() {
return axios.get(this.endpoint).then((response) => response.data);
}
enableKey(id) {
return axios.put(`${this.endpoint}/${id}/enable`).then((response) => response.data);
}
disableKey(id) {
return axios.put(`${this.endpoint}/${id}/disable`).then((response) => response.data);
}
}