Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] - uploadFiles() cannot upload image files as it is #58

Open
bentshrimp opened this issue Aug 29, 2023 · 1 comment
Open

🐛 [BUG] - uploadFiles() cannot upload image files as it is #58

bentshrimp opened this issue Aug 29, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@bentshrimp
Copy link
Contributor

Browsers

Chrome

OS

Linux

Description

uploadFiles() has four steps

  1. get the branch data including current commit hash
  2. add files into the tree
  3. create a new commit
  4. update the branch

At the second step, tree parameter is supposed to get different mode depend on the file type.
두번째 단계에서, tree 매개변수는 파일의 유형에 다라 다른 mode 값을 가져야 합니다.

Reasons

      // add files into the tree
      const tree = await octokit.rest.git.createTree({
        owner: userName,
        repo: repoName,
        base_tree: baseTree,
        tree: files.map((file) => ({
          path: file.path,
          content: file.content,
          mode: '100644',
        })),
      });

It is a problem that when image file is added, the file goes broken.
예를 들면 이미지 파일을 올리면, 파일이 깨지는 문제가 있습니다.
We should fix it so that it can add any types of files.
어떤 유형의 파일이든 추가할 수 있도록 고쳐야 합니다.

Reproduction URL

localhost:8080/

Reproduction Steps

1. Add a function that check if file is image
이미지 파일인지 확인하는 함수를 만든다.
2. Figure out how to add image file as it is. NOT AS STRING.
어떻게 이미지 파일을 있는 그대로 올릴지 알아낸다. 문자열로가 아니라.

Solutions

No response

Screenshots

![DESCRIPTION](LINK.png)
@bentshrimp bentshrimp added the bug Something isn't working label Aug 29, 2023
@bentshrimp bentshrimp changed the title 🐛 [BUG] - <title> 🐛 [BUG] - uploadFiles() cannot upload image files as it is Aug 29, 2023
@bentshrimp bentshrimp self-assigned this Aug 29, 2023
@ymw0407
Copy link
Member

ymw0407 commented Oct 6, 2023

First of all, as the next best option, all images of the templates were replaced with svg.
우선 차선책으로 template들의 image들을 전부 svg로 대체하였다.

resolved at this PR #129

@ymw0407 ymw0407 self-assigned this Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants