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

프로필 수정 페이지 이미지 설정되지 않는 이슈 #297

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

yws1502
Copy link
Collaborator

@yws1502 yws1502 commented Feb 23, 2025

🔗 연관된 이슈


🗒 작업 목록

  • 프로필 사진 업로드 공용 컴포넌트 개발 및 적용

🧐 PR Point

  • 회원가입과 프로필 수정 페이지에서 사용되는 프로필 사진 업로드 로직을 하나의 공용 컴포넌트(ProfileUpload)로 분리하였습니다.
  • 변경한 이미지 경로를 hook form에 추가하는 로직을 추가하였습니다.
  • 기본 프로필 이미지를 선택하여 이미지 경로를 저장하는 로직에서 Ref를 제거하였습니다.
    • 기본 프로필 이미지 선택 시 해당 이미지의 경로가 state에 저장되도록 개선하였습니다.
  • 프로필 수정 커스텀 훅에서 요청 성공 시 반환되는 데이터의 username을 활용하도록 개선하였습니다.
    • 프로필 수정 API(PUT /users)의 경우 응답값으로 요청한 유저의 최신 값을 반환하고 있는데, 코드 상에 Partial 제네릭 타입으로 묶여 각 값이 undefined 처리가 되고 있었습니다. 이와 같은 이유로 Partial 제네릭 타입 제거해주었습니다.

💥 Trouble Shooting

  • 해당 작업을 하던 중 발생했던 문제에 대해 작성해주세요.

📸 스크린샷 / 피그마 링크

2025-02-23.11.35.50.mov

📚 참고

  • 참고한 내용 또는 링크를 입력해주세요.

✅ PR Submit 전 체크리스트

  • Merge 하는 브랜치는 main 브랜치가 아닙니다.
  • 코드에 크리티컬한 error 또는 warning이 존재하지 않습니다.
  • 불필요한 console이 존재하지 않습니다.

@yws1502 yws1502 added the 🐛 bug 버그 발생 label Feb 23, 2025
@yws1502 yws1502 self-assigned this Feb 23, 2025
Copy link

vercel bot commented Feb 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
a-daily-diary ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2025 2:36am

Comment on lines +76 to +83
useEffect(() => {
if (previewImage.length === 0) {
alertAction('선택된 이미지가 없습니다. 다시 시도해주세요.');
return;
}

setValue('imgUrl', previewImage);
}, [previewImage]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useEffect 제거하고, onSubmit 할 때 imgUrl에 previewImage 값 전달하면 될 것 같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug 버그 발생
Projects
None yet
Development

Successfully merging this pull request may close these issues.

프로필 수정 페이지 이미지 설정되지 않는 이슈
2 participants