Skip to content

Commit

Permalink
[Common] [Feat] 건너뛰기 누락된 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
suwonthugger committed Nov 10, 2024
1 parent b163bea commit cb5697d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 9 deletions.
25 changes: 23 additions & 2 deletions apps/mobile/src/app/auth/_components/authRegion/authRegion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,28 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => {

const handle회원가입 = () => {
mutate(
{ univName: 대학교, region: 지역검색키워드 },
{
univName: 대학교.length === 0 ? null : 대학교,
region: 지역검색키워드.length === 0 ? null : 지역검색키워드,
},
{
onSuccess: () => {
handleNextStep('completion');
},
onError: (error) => {
alert('회원가입에 실패했습니다. 다시 시도해주세요.');
console.error(error);
},
},
);
};

const handle건너뛰기 = () => {
mutate(
{
univName: 대학교.length === 0 ? null : 대학교,
region: null,
},
{
onSuccess: () => {
handleNextStep('completion');
Expand Down Expand Up @@ -110,7 +131,7 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => {
cancelText="취소"
confirmText="확인"
triggerText="건너뛰기"
onConfirm={() => handleNextStep('completion')}
onConfirm={handle건너뛰기}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps)
);
};

const handle건너뛰기 = () => {
handleNextStep('region');
handle대학교변경('');
};

return (
<div className={container}>
<div className={topDivStyle}>
Expand Down Expand Up @@ -179,7 +184,7 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps)
cancelText="취소"
confirmText="확인"
triggerText="건너뛰기"
onConfirm={() => handleNextStep('region')}
onConfirm={handle건너뛰기}
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/shared/apis/auth/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export namespace PostUnivValidate {

export namespace PostAuthJoin {
export interface Params {
univName: string;
region: string;
univName: string | null;
region: string | null;
}
}

Expand Down
20 changes: 19 additions & 1 deletion apps/web/src/app/auth/_components/authRegion/authRegion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => {
);
};

const handle건너뛰기 = () => {
mutate(
{
univName: 대학교.length === 0 ? null : 대학교,
region: null,
},
{
onSuccess: () => {
handleNextStep('completion');
},
onError: (error) => {
alert('회원가입에 실패했습니다. 다시 시도해주세요.');
console.error(error);
},
},
);
};

return (
<section className={sectionStyle}>
<div>
Expand Down Expand Up @@ -115,7 +133,7 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => {
cancelText="취소"
confirmText="확인"
triggerText="건너뛰기"
onConfirm={() => {}}
onConfirm={handle건너뛰기}
/>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/app/auth/_components/authSchool/authSchool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps)
);
};

const handle건너뛰기 = () => {
handleNextStep('region');
handle대학교변경('');
};

return (
<section className={sectionStyle}>
<div>
Expand Down Expand Up @@ -175,7 +180,7 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps)
cancelText="취소"
confirmText="확인"
triggerText="건너뛰기"
onConfirm={() => {}}
onConfirm={handle건너뛰기}
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/shared/apis/auth/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export namespace PostUnivValidate {

export namespace PostAuthJoin {
export interface Params {
univName: string;
region: string;
univName: string | null;
region: string | null;
}
}

Expand Down

0 comments on commit cb5697d

Please sign in to comment.