debian-mirror-gitlab/app/assets/javascripts/deploy_keys/service/index.js
2018-12-13 13:39:08 +05:30

21 lines
462 B
JavaScript

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);
}
}