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

20 lines
465 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) {
2020-11-24 15:15:51 +05:30
this.endpoint = endpoint;
2017-08-17 22:00:37 +05:30
}
getKeys() {
2021-03-08 18:12:59 +05:30
return axios.get(this.endpoint).then((response) => response.data);
2017-08-17 22:00:37 +05:30
}
enableKey(id) {
2021-03-08 18:12:59 +05:30
return axios.put(`${this.endpoint}/${id}/enable`).then((response) => response.data);
2017-08-17 22:00:37 +05:30
}
disableKey(id) {
2021-03-08 18:12:59 +05:30
return axios.put(`${this.endpoint}/${id}/disable`).then((response) => response.data);
2017-08-17 22:00:37 +05:30
}
}