{"size": 421, "ext": "js", "max_stars_repo_path": "slack/modal.js", "max_stars_repo_name": "mayankpatel202/Gprep", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "slack/modal.js", "max_issues_repo_name": "mayankpatel202/Gprep", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "slack/modal.js", "max_forks_repo_name": "mayankpatel202/Gprep", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.7647058824, "max_line_length": 78, "alphanum_fraction": 0.5890736342}
const api = require('./apis');

module.exports = async (view, trigger_id, token) => {
  let url = 'https://slack.com/api/views.open';
  let body = {
    trigger_id,
    view,
  }
  let config = {
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`
    }
  }
  return api.post(url, body, config)
         .then((response) => console.log("Modal Open: ", response.view.state))
}