debian-mirror-gitlab/app/assets/javascripts/deploy_keys/service/index.js
2020-11-24 15:15:51 +05:30

19 lines
459 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);
}
}