-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 응답 변수명 수정 #47
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
feat: 응답 변수명 수정 #47
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| import BusinessInfo from "@/components/common/BusinessInfo"; | ||
| import NoticeSection from "./NoticeSection"; | ||
| import ProfileSlider from "./ProfileSlider"; | ||
| import { ProfileData, ContactFrequency } from "@/lib/types/profile"; | ||
| import ChargeRequestWaiting from "./ChargeRequestWaiting"; | ||
|
|
||
| import { useMatchingHistory } from "@/hooks/useMatchingHistory"; | ||
|
|
@@ -48,12 +48,13 @@ | |
| const profileList: ProfileData[] = | ||
| historyData?.data.content.map(({ partner }) => ({ | ||
| ...partner, | ||
| // API에서 null로 올 수 있는 필드들만 안전하게 변환 | ||
| // API에서 필드명이 변경되었거나 null로 올 수 있는 필드들만 안전하게 변환 | ||
| profileImageUrl: partner.profileImageKey, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Image key passed to image ScreenMainPage assigns partner.profileImageKey into profileImageUrl, but ProfileCard passes profileImageUrl directly to next/image as src. Since profileImageKey is an object key (e.g. "default_bear" / S3 key) rather than a URL/path starting with "/" or "http", next/image will error or render broken images on the main page. Agent Prompt
|
||
| intro: partner.intro ?? undefined, | ||
| socialType: partner.socialType ?? undefined, | ||
| socialAccountId: partner.socialAccountId ?? "", | ||
| advantages: partner.advantages ?? undefined, | ||
| favoriteSong: partner.favoriteSong ?? undefined, | ||
| tags: partner.tags ?? undefined, | ||
| song: partner.song ?? undefined, | ||
| })) || []; | ||
|
|
||
| return ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,27 +119,30 @@ const TermsDrawer = ({ children }: TermsDrawerProps) => { | |
| birthDate: profile.birthDate || "", | ||
| mbti: profile.mbti || "ISTJ", | ||
| intro: profile.intro || "", | ||
| profileImageUrl: finalImageUrl || profile.profileImageUrl || "", | ||
| socialType: profile.socialType || null, | ||
| socialAccountId: profile.socialAccountId || null, | ||
| university: profile.university || "가톨릭대학교", | ||
| profileImageKey: finalImageUrl || "default", | ||
| socialType: | ||
| profile.socialType && profile.socialAccountId | ||
| ? profile.socialType | ||
| : null, | ||
| socialAccountId: | ||
| profile.socialType && profile.socialAccountId | ||
| ? profile.socialAccountId | ||
| : null, | ||
|
Comment on lines
+123
to
+130
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 소셜 정보 유효성을 확인하는 예시: const hasSocialInfo = profile.socialType && profile.socialAccountId;
const submitData: ProfileSubmitData = {
// ...
socialType: hasSocialInfo ? profile.socialType : null,
socialAccountId: hasSocialInfo ? profile.socialAccountId : null,
// ...
}; |
||
| university: profile.university || "", | ||
| major: profile.major || "", | ||
| contactFrequency: profile.contactFrequency || "NORMAL", | ||
| hobbies: mapHobbies(profile.hobbies || []), | ||
| intros: profile.intros || [], | ||
| advantages: | ||
| profile.advantages && profile.advantages.length > 0 | ||
| ? profile.advantages | ||
| : null, | ||
| favoriteSong: profile.favoriteSong || null, | ||
| tags: profile.tags && profile.tags.length > 0 ? profile.tags : null, | ||
| song: profile.song || null, | ||
| }; | ||
|
|
||
| // 3. 백엔드로 전송 | ||
| signUp(submitData, { | ||
| onSuccess: () => { | ||
| setIsOpen(false); | ||
| clearProfile(); | ||
| router.push("/main"); // 가입 완료 페이지로 이동 | ||
| router.push("/main"); // 가입 완료 주소로 이동 | ||
| }, | ||
| onError: (error) => { | ||
| console.error("Signup failed:", error); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이모지 제거를 위한 정규식과 로직이
app/profile-image/_components/TermsDrawer.tsx파일에서도 중복으로 사용되고 있습니다. 코드 중복을 피하고 유지보수성을 높이기 위해 이 로직을lib/utils.ts와 같은 공통 유틸리티 파일로 추출하는 것을 권장합니다.또한, 더 간결하고 표준적인 유니코드 속성 이스케이프(Unicode property escapes)
\p{Emoji}를 사용하면 가독성을 향상시킬 수 있습니다.References