mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-04-23 11:02: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
18
src/utils.js
18
src/utils.js
@ -34,17 +34,13 @@ function isValidHexColor(hexColor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function request(data) {
|
function request(data) {
|
||||||
return new Promise((resolve, reject) => {
|
return axios({
|
||||||
axios({
|
url: "https://api.github.com/graphql",
|
||||||
url: "https://api.github.com/graphql",
|
method: "post",
|
||||||
method: "post",
|
headers: {
|
||||||
headers: {
|
Authorization: `bearer ${process.env.GITHUB_TOKEN}`,
|
||||||
Authorization: `bearer ${process.env.GITHUB_TOKEN}`,
|
},
|
||||||
},
|
data,
|
||||||
data,
|
|
||||||
})
|
|
||||||
.then((response) => resolve(response))
|
|
||||||
.catch((error) => reject(error));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user