mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-04-22 18:42:09 +00:00
chore: remove redundant codes
`axios` is Promise based, there is no need to wrap it into a Promise constructor again
This commit is contained in:
parent
2efb399f33
commit
579ed2bab8
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user