Skip to content

Commit f487345

Browse files
committed
📦NEW: options
1 parent 27136f0 commit f487345

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

utils/createRepo.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,22 @@ module.exports = async () => {
4444
auto_init,
4545
};
4646

47-
await axios
48-
.post(`https://api.github.com/user/repos?${headers.Authorization}`, {
49-
headers: headers,
50-
body: JSON.stringify(payLoad),
51-
})
47+
const options = {
48+
method: "POST",
49+
headers: headers,
50+
data: JSON.stringify(payLoad),
51+
url: `https://api.github.com/user/repos`,
52+
};
53+
54+
await axios(options)
5255
.then((res) => {
5356
const name = "👌 DONE";
5457
const msg = "Repo Successfully Created!!";
5558
box(name, msg);
5659
})
5760
.catch((err) => {
58-
console.log(err);
61+
console.log(err.response.config.headers);
62+
console.log(err.response.data);
5963

6064
const name = "⚠️ WARNING";
6165
const msg = "Repo Creation Failed!!";

0 commit comments

Comments
 (0)