Unverified Commit 579ed2ba authored by JounQin's avatar JounQin Committed by GitHub
Browse files

chore: remove redundant codes

`axios` is Promise based, there is no need to wrap it into a Promise constructor again
parent 2efb399f
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -34,17 +34,13 @@ function isValidHexColor(hexColor) {
}

function request(data) {
  return new Promise((resolve, reject) => {
    axios({
  return axios({
    url: "https://api.github.com/graphql",
    method: "post",
    headers: {
      Authorization: `bearer ${process.env.GITHUB_TOKEN}`,
    },
    data,
    })
      .then((response) => resolve(response))
      .catch((error) => reject(error));
  });
}