Skip to content

Commit

Permalink
fix(web-domains): 자기소개 정보 중 optional 데이터 대응 (#163)
Browse files Browse the repository at this point in the history
* fix: 스키마 수정 및 널러블 필터 수정

* fix: 빈 문자열도 잡도록 추가
  • Loading branch information
Doeunnkimm authored Aug 27, 2024
1 parent 930229c commit 8ef90f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface MeetingMemberResponse {
birth: string;
job: string;
location: string;
hobbies: Array<string>;
mbti: string;
introduction: string;
hobbies?: Array<string>;
mbti?: string;
introduction?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Profile = (props: ProfileProps) => {
const age = birthFromProps && generateAge(birthFromProps);
const gender = generateGender(genderFromProps);

const infoBadges = [age, gender, mbti, location, job].filter(Boolean);
const infoBadges = [age, gender, mbti, location, job].filter((value) => value != null);

return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useGetMemberByParams } from '../hooks/useGetMemberByParams';
export const AboutMeContainer = () => {
const { data } = useGetMemberByParams();

const hasNoInfo = !data?.hobbies.length && !data?.introduction.length;
const hasNoInfo = data?.hobbies == null && (data?.introduction == null || data?.introduction === '');

if (hasNoInfo) return <EmptyView title="아직 입력한 정보가 없어요" style={{ height: '300px' }} />;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AboutMeProps {
}

export const AboutMe = ({ info }: AboutMeProps) => {
const hasNoInfo = !info?.hobbies.length && !info?.introduction;
const hasNoInfo = info?.hobbies == null && (info?.introduction == null || info?.introduction === '');

if (hasNoInfo) return <EmptyView title="아직 입력한 정보가 없어요" style={{ height: '300px' }} />;

Expand Down

0 comments on commit 8ef90f2

Please sign in to comment.