debian-mirror-gitlab/app/assets/javascripts/deploy_keys/service/index.js

22 lines
462 B
JavaScript
Raw Normal View History

2018-11-08 19:23:39 +05:30
import axios from '~/lib/utils/axios_utils';
2017-08-17 22:00:37 +05:30
export default class DeployKeysService {
constructor(endpoint) {
2018-11-08 19:23:39 +05:30
this.axios = axios.create({
baseURL: endpoint,
});
2017-08-17 22:00:37 +05:30
}
getKeys() {
2018-12-13 13:39:08 +05:30
return this.axios.get().then(response => response.data);
2017-08-17 22:00:37 +05:30
}
enableKey(id) {
2018-12-13 13:39:08 +05:30
return this.axios.put(`${id}/enable`).then(response => response.data);
2017-08-17 22:00:37 +05:30
}
disableKey(id) {
2018-12-13 13:39:08 +05:30
return this.axios.put(`${id}/disable`).then(response => response.data);
2017-08-17 22:00:37 +05:30
}
}