2020-06-22 07:49:26 +00:00
|
|
|
/* global axios */
|
|
|
|
|
|
|
|
import ApiClient from './ApiClient';
|
|
|
|
|
|
|
|
class IntegrationsAPI extends ApiClient {
|
|
|
|
constructor() {
|
|
|
|
super('integrations/apps', { accountScoped: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
connectSlack(code) {
|
|
|
|
return axios.post(`${this.baseUrl()}/integrations/slack`, {
|
|
|
|
code: code,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
delete(integrationId) {
|
|
|
|
return axios.delete(`${this.baseUrl()}/integrations/${integrationId}`);
|
|
|
|
}
|
2021-06-06 11:29:05 +00:00
|
|
|
|
|
|
|
createHook(hookData) {
|
|
|
|
return axios.post(`${this.baseUrl()}/integrations/hooks`, hookData);
|
|
|
|
}
|
|
|
|
|
|
|
|
deleteHook(hookId) {
|
|
|
|
return axios.delete(`${this.baseUrl()}/integrations/hooks/${hookId}`);
|
|
|
|
}
|
2020-06-22 07:49:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new IntegrationsAPI();
|