Skip to content

Commit 501a64e

Browse files
committed
fix issues
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
1 parent 7a5e55e commit 501a64e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

js/formDataToJson.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async function createBranchOnProject(projectURL, token)
119119
{
120120
const {owner, repo} = getOrgAndRepoArgsGitHub(projectURL);
121121

122-
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/git/refs/heads/main}`,
122+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/git/refs/heads/main`,
123123
{
124124
method: 'GET',
125125
headers: {
@@ -175,7 +175,8 @@ async function addFileToBranch(projectURL, token, codeJSONObj)
175175
const {owner, repo} = getOrgAndRepoArgsGitHub(projectURL);
176176
const FILE_PATH = 'code.json'
177177
const createFileApiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${FILE_PATH}`;
178-
const encodedContent = Buffer.from(codeJSONObj).toString('base64');
178+
const encodedContent = btoa(codeJSONObj);
179+
console.log("Content: ", encodedContent);
179180

180181
const response = await fetch(createFileApiUrl,
181182
{

0 commit comments

Comments
 (0)