gitlab-org--gitlab-foss/app/assets/javascripts/deploy_keys/service/index.js

25 lines
483 B
JavaScript
Raw Normal View History

2018-05-09 17:57:01 +00:00
import axios from '~/lib/utils/axios_utils';
export default class DeployKeysService {
constructor(endpoint) {
2018-05-09 17:57:01 +00:00
this.axios = axios.create({
baseURL: endpoint,
});
}
getKeys() {
2018-05-09 17:57:01 +00:00
return this.axios.get()
.then(response => response.data);
}
enableKey(id) {
2018-05-09 17:57:01 +00:00
return this.axios.put(`${id}/enable`)
.then(response => response.data);
}
disableKey(id) {
2018-05-09 17:57:01 +00:00
return this.axios.put(`${id}/disable`)
.then(response => response.data);
}
}