Skip to content

[feat] S3 프로필 이미지 로직수정#112

Merged
shinwokkang merged 2 commits intodevfrom
feat/101-auth-api
Feb 23, 2026
Merged

[feat] S3 프로필 이미지 로직수정#112
shinwokkang merged 2 commits intodevfrom
feat/101-auth-api

Conversation

@shinwokkang
Copy link
Contributor

📌 개요 (Summary)

  • 변경 사항에 대한 간략한 요약을 적어주세요.
  • 관련 이슈가 있다면 링크를 걸어주세요 (예: [fix] cicd / build 문제 #123).

🛠️ 변경 사항 (Changes)

  • 새로운 기능 추가
  • 버그 수정
  • 코드 리팩토링
  • 문서 업데이트
  • 기타 (설명: )

📸 스크린샷 (Screenshots)

(UI 변경 사항이 있다면 첨부해주세요)

✅ 체크리스트 (Checklist)

  • 빌드가 성공적으로 수행되었나요? (pnpm build)
  • 린트 에러가 없나요? (pnpm lint)
  • 불필요한 콘솔 로그나 주석을 제거했나요?

@shinwokkang shinwokkang self-assigned this Feb 23, 2026
@shinwokkang shinwokkang added the ✨ feat 새로운 기능 추가 label Feb 23, 2026
@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
check-mo Ready Ready Preview Feb 23, 2026 5:25am

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/101-auth-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shinwokkang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 S3 프로필 이미지 업로드 로직을 개선하고, 회원가입 과정의 오류 처리 방식을 현대화하며, 관심사 카테고리 데이터를 중앙 관리하도록 리팩토링합니다. 이를 통해 코드의 일관성을 높이고, 사용자 경험을 향상시키며, 향후 기능 확장을 용이하게 합니다.

Highlights

  • S3 프로필 이미지 로직 수정: 프로필 이미지 관련 로직을 S3 업로드에 더 적합하도록 수정했습니다. 특히, 이미 업로드된 URL 처리 로직을 개선했습니다.
  • 오류 처리 로직 개선: 회원가입 및 추가 정보 저장 시 오류 처리 로직을 개선하여 error instanceof Error를 명시적으로 확인하고, response.isSuccess 확인 없이 성공 시 다음 단계를 진행하도록 변경했습니다.
  • 관심사 카테고리 중앙화: 기존 useProfileImage.ts에 분산되어 있던 관심사 카테고리 데이터를 src/constants/categories.ts 파일로 중앙화하여 재사용성과 유지보수성을 높였습니다.
  • 기본 프로필 이미지 경로 업데이트: 기본 프로필 이미지 경로를 /default_profile_1.svg에서 /profile.svg로 업데이트했습니다.
  • 이미지 업로드 API 엔드포인트 추가: 이미지 업로드를 위한 Presigned URL을 가져오는 IMAGE_UPLOAD API 엔드포인트를 AUTH_ENDPOINTS에 추가하고 authService에서 이를 활용하도록 변경했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/components/base-ui/Join/steps/PasswordEntry/PasswordEntry.tsx
    • 회원가입 성공 응답 확인 로직을 제거하고, 오류 발생 시 error instanceof Error를 사용하여 메시지를 처리하도록 변경했습니다.
  • src/components/base-ui/Join/steps/ProfileImage/InterestCategorySelector.tsx
    • 관심사 카테고리 데이터를 useProfileImage 파일 대신 src/constants/categories.ts에서 CATEGORIES를 임포트하여 사용하도록 변경했습니다.
    • 카테고리 렌더링 로직을 CATEGORIES 객체의 valuelabel 속성을 사용하도록 업데이트했습니다.
  • src/components/base-ui/Join/steps/ProfileImage/ProfileImageUploader.tsx
    • 기본 프로필 이미지 경로를 /default_profile_1.svg에서 /profile.svg로 변경했습니다.
  • src/components/base-ui/Join/steps/ProfileImage/useProfileImage.ts
    • 로컬에 정의되어 있던 INTEREST_CATEGORIES 배열과 CATEGORY_MAP 객체를 제거하고 src/constants/categories.ts에서 CATEGORY_MAP을 임포트하도록 변경했습니다.
    • 프로필 이미지 초기화 및 기본값 설정 시 /default_profile_1.svg 대신 /profile.svg를 사용하도록 업데이트했습니다.
    • 이미지 URL 검사 로직에서 default_profile 문자열 포함 여부 확인을 제거했습니다.
    • 추가 정보 저장 시 response.isSuccess 확인 로직을 제거하고, 오류 발생 시 error instanceof Error를 사용하여 메시지를 처리하도록 변경했습니다.
  • src/constants/categories.ts
    • 관심사 카테고리 목록과 해당 카테고리의 매핑 정보를 담은 CATEGORIES 배열과 CATEGORY_MAP 객체를 새로 추가했습니다.
  • src/lib/api/endpoints.ts
    • 이미지 업로드를 위한 Presigned URL을 가져오는 IMAGE_UPLOAD 엔드포인트를 AUTH_ENDPOINTS에 추가했습니다.
  • src/services/authService.ts
    • getPresignedUrl 함수에서 이미지 업로드 엔드포인트를 하드코딩된 문자열 대신 AUTH_ENDPOINTS.IMAGE_UPLOAD를 사용하도록 변경했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@shinwokkang shinwokkang merged commit eafc56d into dev Feb 23, 2026
4 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 프로필 이미지 및 관심 카테고리 선택 로직을 리팩터링하고 S3 이미지 업로드 로직을 수정합니다. 전반적으로 코드 구조를 개선하는 좋은 변경 사항들이 포함되어 있습니다. 상수 중앙화, 오류 처리 개선 등 긍정적인 변화가 많습니다. 다만, 몇 가지 잠재적인 문제점과 개선 사항을 발견하여 리뷰 코멘트를 남겼습니다. 기본 프로필 이미지 경로 처리의 불일치 문제, 카테고리 매핑 로직의 혼란 가능성, 그리고 API 엔드포인트의 타입 안정성 강화에 대한 제안을 확인해주시면 좋겠습니다.

}
} else if (imgUrl && !imgUrl.startsWith("blob:") && !imgUrl.includes("default_profile")) {
// Already uploaded URL (e.g. from previous attempt or social)
} else if (imgUrl && !imgUrl.startsWith("blob:")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

high

이 로직 변경으로 기본 이미지 경로도 서버로 전송될 수 있게 되었습니다. 하지만 SignupContextprofileImage 초기값이 "/default_profile_1.svg"로 남아있어, 사용자가 이미지를 변경하지 않으면 이전 기본 이미지 경로가 전송됩니다. 이 PR의 다른 변경사항들(handleResetImage 등)은 "/profile.svg"를 사용하고 있어 불일치가 발생합니다. SignupContext.tsx의 초기 상태도 "/profile.svg"로 업데이트하거나, 혹은 서버로 전송하기 전에 기본 이미지 경로를 통일된 값으로 변경하는 로직이 필요해 보입니다.

}

// 2. Submit all info to additional-info endpoint
const categories = selectedInterests.map((c: string) => CATEGORY_MAP[c] || c);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

selectedInterests 배열에는 이제 카테고리 label이 아닌 value가 저장됩니다. CATEGORY_MAPlabelvalue로 변환하는 객체이므로, CATEGORY_MAP[c]는 항상 undefined가 됩니다. 코드가 || c 덕분에 의도대로 동작하기는 하지만, 혼란을 줄 수 있으므로 매핑 로직을 제거하는 것이 좋습니다.

Suggested change
const categories = selectedInterests.map((c: string) => CATEGORY_MAP[c] || c);
const categories = selectedInterests;

ADDITIONAL_INFO: `${API_BASE_URL}/members/additional-info`,
CHECK_NICKNAME: `${API_BASE_URL}/members/check-nickname`,
PROFILE: `${API_BASE_URL}/members/me`,
IMAGE_UPLOAD: (type: string) => `${API_BASE_URL}/image/${type}/upload-url`,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

type 매개변수를 string으로 지정하는 것보다 authService.ts에서 사용되는 것처럼 더 구체적인 타입 ("PROFILE" | "CLUB" | "NOTICE")으로 지정하면 타입 안정성을 높일 수 있습니다. 이렇게 하면 잘못된 이미지 타입을 사용하는 것을 컴파일 시점에 방지할 수 있습니다.

Suggested change
IMAGE_UPLOAD: (type: string) => `${API_BASE_URL}/image/${type}/upload-url`,
IMAGE_UPLOAD: (type: "PROFILE" | "CLUB" | "NOTICE") => `${API_BASE_URL}/image/${type}/upload-url`,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant