Skip to content

Commit 49680d6

Browse files
fix: regression with create repository implemenation (#80)
* fix: regression consume GitHub API the recommended way * fix: lint Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
1 parent a6743a1 commit 49680d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/github.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ const createRepository = async () => {
9292
type: 'input',
9393
validate,
9494
});
95-
const API_URL = `https://api.github.com/user/repos?access_token=${userToken}`;
9695

96+
const API_URL = `https://api.github.com/user/repos`;
97+
axios.defaults.headers.common['Authorization'] = `token ${userToken}`;
9798
// Create a new repository.
9899
try {
99100
await axios.post(API_URL, { name: 'teachcode-solutions' });

0 commit comments

Comments
 (0)