@@ -12,7 +12,7 @@ import SignupPrepareScreen from "./SignupPrepareScreen";
1212import SignupProfileScreen from "./SignupProfileScreen" ;
1313import SignupRegionScreen from "./SignupRegionScreen" ;
1414
15- import { Gender , PreparationStatus , SignUpRequest } from "@/types/auth" ;
15+ import { PreparationStatus , SignUpRequest } from "@/types/auth" ;
1616import { RegionKo } from "@/types/university" ;
1717
1818type SignupSurveyProps = {
@@ -32,47 +32,15 @@ const SignupSurvey = ({ signUpToken, baseNickname, baseEmail, baseProfileImageUr
3232 const [ countries , setCountries ] = useState < string [ ] > ( [ ] ) ;
3333
3434 const [ nickname , setNickname ] = useState < string > ( baseNickname ) ;
35- const [ gender , setGender ] = useState < Gender | "" > ( "" ) ;
36- const [ birth , setBirth ] = useState < string > ( "" ) ;
3735 const [ profileImageFile , setProfileImageFile ] = useState < File | null > ( null ) ;
3836
39- const convertBirth = ( value : string ) : string => {
40- if ( value . length !== 8 ) {
41- throw new Error ( "생년월일을 8자리로 입력해주세요." ) ;
42- }
43-
44- const year = value . substring ( 0 , 4 ) ;
45- const month = value . substring ( 4 , 6 ) ;
46- const day = value . substring ( 6 , 8 ) ;
47-
48- const formattedDate = `${ year } -${ month } -${ day } ` ;
49-
50- const date = new Date ( formattedDate ) ;
51- const isValidDate =
52- date . getFullYear ( ) === parseInt ( year , 10 ) &&
53- date . getMonth ( ) + 1 === parseInt ( month , 10 ) &&
54- date . getDate ( ) === parseInt ( day , 10 ) ;
55-
56- if ( ! isValidDate ) {
57- throw new Error ( "유효한 날짜가 아닙니다." ) ;
58- }
59-
60- return formattedDate ;
61- } ;
62-
6337 const createRegisterRequest = async ( ) : Promise < SignUpRequest > => {
6438 const submitRegion : RegionKo [ ] = region === "아직 잘 모르겠어요" ? [ ] : [ region as RegionKo ] ;
6539
6640 if ( ! curPreparation ) {
6741 throw new Error ( "준비 단계를 선택해주세요" ) ;
6842 }
6943
70- if ( gender === "" ) {
71- throw new Error ( "성별을 선택해주세요" ) ;
72- }
73-
74- const convertedBirth : string = convertBirth ( birth ) ;
75-
7644 let imageUrl : string | null = baseProfileImageUrl ;
7745
7846 if ( profileImageFile ) {
@@ -92,8 +60,6 @@ const SignupSurvey = ({ signUpToken, baseNickname, baseEmail, baseProfileImageUr
9260 preparationStatus : curPreparation ,
9361 nickname,
9462 profileImageUrl : imageUrl ,
95- gender,
96- birth : convertedBirth ,
9763 } ;
9864 } ;
9965
@@ -155,10 +121,6 @@ const SignupSurvey = ({ signUpToken, baseNickname, baseEmail, baseProfileImageUr
155121 toNextStage = { submitRegisterRequest }
156122 nickname = { nickname }
157123 setNickname = { setNickname }
158- gender = { gender }
159- setGender = { setGender }
160- birth = { birth }
161- setBirth = { setBirth }
162124 defaultProfileImageUrl = { baseProfileImageUrl }
163125 profileImageFile = { profileImageFile }
164126 setProfileImageFile = { setProfileImageFile }
0 commit comments