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

24 lines
483 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);
}
}