ish-cd/api-client-js

View on GitHub
src/integration/slack/client.js

Summary

Maintainability
A
2 hrs
Test Coverage
'use strict';

let apiClient;

class SlackIntegrationIsh {

  constructor(client, identifier, data = {}) {
    apiClient = client;
    this.identifier = identifier;
    this.data = data;
  }

  /**
   * De-authorizes this Slack Integration.
   *
   * @returns {Promise}
   */
  remove() {
    return new Promise((resolve, reject) => {
      apiClient.del(`/integrations/slack/${this.identifier}`).then(() => {
        resolve();
      }).catch((err) => {
        reject(err);
      });
    });
  }

}

export default SlackIntegrationIsh;