diff --git a/apps/mobile/src/app/auth/_components/authRegion/authRegion.tsx b/apps/mobile/src/app/auth/_components/authRegion/authRegion.tsx index f25a9a7..f0a97ca 100644 --- a/apps/mobile/src/app/auth/_components/authRegion/authRegion.tsx +++ b/apps/mobile/src/app/auth/_components/authRegion/authRegion.tsx @@ -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'); @@ -110,7 +131,7 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => { cancelText="취소" confirmText="확인" triggerText="건너뛰기" - onConfirm={() => handleNextStep('completion')} + onConfirm={handle건너뛰기} /> diff --git a/apps/mobile/src/app/auth/_components/authSchool/authSchool.tsx b/apps/mobile/src/app/auth/_components/authSchool/authSchool.tsx index 5844d87..39ff4f3 100644 --- a/apps/mobile/src/app/auth/_components/authSchool/authSchool.tsx +++ b/apps/mobile/src/app/auth/_components/authSchool/authSchool.tsx @@ -100,6 +100,11 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps) ); }; + const handle건너뛰기 = () => { + handleNextStep('region'); + handle대학교변경(''); + }; + return (
@@ -179,7 +184,7 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps) cancelText="취소" confirmText="확인" triggerText="건너뛰기" - onConfirm={() => handleNextStep('region')} + onConfirm={handle건너뛰기} />
diff --git a/apps/mobile/src/shared/apis/auth/types/index.ts b/apps/mobile/src/shared/apis/auth/types/index.ts index 2cb31a7..8217acc 100644 --- a/apps/mobile/src/shared/apis/auth/types/index.ts +++ b/apps/mobile/src/shared/apis/auth/types/index.ts @@ -15,8 +15,8 @@ export namespace PostUnivValidate { export namespace PostAuthJoin { export interface Params { - univName: string; - region: string; + univName: string | null; + region: string | null; } } diff --git a/apps/web/src/app/auth/_components/authRegion/authRegion.tsx b/apps/web/src/app/auth/_components/authRegion/authRegion.tsx index 041d6ed..d018e79 100644 --- a/apps/web/src/app/auth/_components/authRegion/authRegion.tsx +++ b/apps/web/src/app/auth/_components/authRegion/authRegion.tsx @@ -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 (
@@ -115,7 +133,7 @@ const AuthRegion = ({ handleNextStep, 대학교 }: AuthRegionProps) => { cancelText="취소" confirmText="확인" triggerText="건너뛰기" - onConfirm={() => {}} + onConfirm={handle건너뛰기} />
diff --git a/apps/web/src/app/auth/_components/authSchool/authSchool.tsx b/apps/web/src/app/auth/_components/authSchool/authSchool.tsx index 66c3672..52a478e 100644 --- a/apps/web/src/app/auth/_components/authSchool/authSchool.tsx +++ b/apps/web/src/app/auth/_components/authSchool/authSchool.tsx @@ -99,6 +99,11 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps) ); }; + const handle건너뛰기 = () => { + handleNextStep('region'); + handle대학교변경(''); + }; + return (
@@ -175,7 +180,7 @@ const AuthSchool = ({ handleNextStep, handle대학교변경 }: AuthSchoolProps) cancelText="취소" confirmText="확인" triggerText="건너뛰기" - onConfirm={() => {}} + onConfirm={handle건너뛰기} />
diff --git a/apps/web/src/shared/apis/auth/types/index.ts b/apps/web/src/shared/apis/auth/types/index.ts index 2cb31a7..8217acc 100644 --- a/apps/web/src/shared/apis/auth/types/index.ts +++ b/apps/web/src/shared/apis/auth/types/index.ts @@ -15,8 +15,8 @@ export namespace PostUnivValidate { export namespace PostAuthJoin { export interface Params { - univName: string; - region: string; + univName: string | null; + region: string | null; } }