Skip to content

Conversation

@youdaeng2
Copy link
Member

📦 Pull Request

📝 요약(Summary)

파일명에 한글이 들어가면 이미지가 깨지는 오류가 있어, 파일명 정규화 유틸 함수를 추가하였습니다. 공용으로 사용하시면 됩니다.

  • 사용 목적

    • 사용자 업로드 파일의 이름을 안전하고 일관된 형식으로 정제
    • 서버 저장 시 발생할 수 있는 충돌, 인코딩 문제, 특수문자 문제 방지
    • 파일 이름 비교를 통한 불필요한 File 생성 최소화
  • sanitizeFileName(originalName, useTimestamp) 유틸 함수 추가

    • 특수문자, 공백, 한글 제거
    • 소문자 변환 및 길이 제한 (50자)
    • 확장자 유지
    • 중복 방지를 위한 타임스탬프 옵션 지원
  • renameFileIfNeeded(file) 유틸 함수 추가

    • 파일 이름이 정제된 이름과 다를 경우에만 새 File 객체 생성
    • 동일한 경우 기존 File 객체 그대로 사용 (리소스 절약)
  • 사용법

    •  const file = e.target.files?.[0];
       const safeFile = renameFileIfNeeded(file); <- 파일 선택 시 작동하는 콜백 함수에 위치
       uploadImage(safeFile);
      

추가 수정

  • 닉네임 인풋에 공백이 들어가면 제출 못하고 경고 toast 띄우게 수정
  • form 제출 시 성공, 에러 토스트 연결 , 인풋 유효성 toast 연결
  • Profile 컴포넌트에 max-w 추가

💬 공유사항 to 리뷰어

🗂️ 관련 이슈

📸 스크린샷

테스트
스크린샷 2025-07-31 212507

✅ 체크리스트

  • 빌드 및 테스트 통과
  • ESLint/Prettier 검사 통과

@youdaeng2 youdaeng2 requested a review from llmojoll July 31, 2025 17:57
@vercel
Copy link

vercel bot commented Jul 31, 2025

@youdaeng2 is attempting to deploy a commit to the 626-ju's projects Team on Vercel.

A member of the Team first needs to authorize it.

@youdaeng2 youdaeng2 merged commit 5c5dd89 into codeit-part3-7:dev Aug 1, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants