Skip to content

issue#91 게시글 작성/수정 페이지 이미지 업로드 오류 수정#92

Merged
gogumalatte merged 3 commits intodevelopfrom
Fix/issue-#91
Feb 25, 2025
Merged

issue#91 게시글 작성/수정 페이지 이미지 업로드 오류 수정#92
gogumalatte merged 3 commits intodevelopfrom
Fix/issue-#91

Conversation

@gogumalatte
Copy link
Contributor

@gogumalatte gogumalatte commented Feb 25, 2025

📝 상세 내용

문제 상황:

이미지(파일) 업로드 시 데이터베이스에 이미지가 쌓이게 됨 -> 근데 이 이미지를 업로드 후 프론트 단에서 백스페이스 키를 눌러서 지우더라도 db에서는 실제로 지워지지 않음 -> 파일이 너무 많이 쓰이면 용량 부족, 과금 등의 문제가 발생할 수도 있기 때문에, db에서도 지우기 위해 각 이미지마다 storageId를 할당하여 적용하기로 함.

해결 방법:

게시글 작성 페이지가 랜더링될 때 api 통신으로 storageId를 받아옴. 이를 변수에 저장하여 이미지 업로드 시 함께 전달하고, 게시글 저장 시에도 body에 담아 함께 전달함. 이제 게시글을 삭제하면 해당 게시글에서 업로드를 했던 모든 사진들이 함께 삭제된다.

postId를 사용하지 않는 이유

게시글이 저장되기 전까지는 postId가 없기 때문에 storageId라는 새로운 값을 사용함.

#️⃣ 이슈 번호

close #91

💬 리뷰 요구사항

⏰ 현재 버그

📷 스크린샷(선택)

🔗 참고 자료(선택)

@gogumalatte gogumalatte self-assigned this Feb 25, 2025
@gogumalatte gogumalatte added 😡 Bug Fix 발생한 버그를 수정하는 경우 ♻️ Refactoring 코드 리팩토링 & 클린 코드 작업을 진행하는 경우 labels Feb 25, 2025
@gogumalatte gogumalatte merged commit da0afbf into develop Feb 25, 2025
1 check passed
@Dobbymin Dobbymin deleted the Fix/issue-#91 branch February 25, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

😡 Bug Fix 발생한 버그를 수정하는 경우 ♻️ Refactoring 코드 리팩토링 & 클린 코드 작업을 진행하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[기능 수정] 게시글 작성/수정 페이지에서 이미지 업로드 시 storageId 할당

1 participant