fbi-cde/crime-data-frontend

View on GitHub
src/util/github.js

Summary

Maintainability
A
0 mins
Test Coverage
import http from 'axios'

const API = 'https://api.github.com'

export const createIssue = ({
  body,
  labels = ['feedback'],
  owner,
  repo,
  title,
  token,
}) => {
  const data = { body, labels, title }
  const headers = {
    Authorization: `token ${token}`,
    Accept: 'application/vnd.github.v3+json',
  }
  return http.post(`${API}/repos/${owner}/${repo}/issues`, data, { headers })
}