Skip to content

Commit

Permalink
Merge pull request #148 from boogiewooki02/feature/reservation
Browse files Browse the repository at this point in the history
Feat: 지원자 이메일 입력란 추가
  • Loading branch information
boogiewooki02 authored Jan 20, 2025
2 parents 9772a10 + dfff8d6 commit b5c7f07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/recruit/(application)/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const page = () => {
major: '',
address: '',
gender: '',
email: '',
});

const [CoverLetterInfo, setCoverLetterInfo] = useState({
Expand All @@ -39,6 +40,7 @@ const page = () => {
major: string;
address: string;
gender: string;
email: string;
}) => {
setPersonalInfo((prevState) => ({
...prevState,
Expand Down Expand Up @@ -81,6 +83,7 @@ const page = () => {
PersonalInfo.name.trim() != '' &&
PersonalInfo.phone_num.trim() != '' &&
PersonalInfo.address.trim() != '' &&
PersonalInfo.email.trim() != '' &&
CoverLetterInfo.career.trim() != '' &&
CoverLetterInfo.determination.trim() != '' &&
CoverLetterInfo.instrument.trim() != '' &&
Expand Down Expand Up @@ -111,17 +114,20 @@ const page = () => {
finish_time: AdditionalInfo.schedule,
meeting: AdditionalInfo.afterparty,
readiness: CoverLetterInfo.determination,
email: PersonalInfo.email,
};

const response = await axiosInstance.post('/apply', formData, {
headers: {
'Content-Type': 'application/json',
},
});
console.log(response.data);

if (response.status === 200) {
window.location.href = `/recruit/complete`;
} else {
alert('지원 실패 다시 시도해주세요');
}
} catch (error: any) {}
}
Expand Down
17 changes: 16 additions & 1 deletion components/templates/apply/ApplicantInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface ApplicantInfoProps {
major: string;
address: string;
gender: string;
email: string;
}) => void;
PersonalInfo: {
name: string;
Expand All @@ -36,14 +37,16 @@ interface ApplicantInfoProps {
major: string;
address: string;
gender: string;
email: string;
};
}

const ApplicantInfo: React.FC<ApplicantInfoProps> = ({
onInfoChange,
PersonalInfo,
}) => {
const { name, birth_date, phone_num, major, address, gender } = PersonalInfo;
const { name, birth_date, phone_num, major, address, gender, email } =
PersonalInfo;

const handleNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {
onInfoChange({ ...PersonalInfo, name: event.target.value });
Expand Down Expand Up @@ -76,6 +79,10 @@ const ApplicantInfo: React.FC<ApplicantInfoProps> = ({
});
};

const handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {
onInfoChange({ ...PersonalInfo, email: event.target.value });
};

return (
<div className="flex flex-col py-10 px-4 pad:px-12">
<div className="flex flex-col pad:flex-row gap-1 pad:gap-3 pad:items-end">
Expand Down Expand Up @@ -111,6 +118,14 @@ const ApplicantInfo: React.FC<ApplicantInfoProps> = ({
onChange={handlePhoneNumChange}
placeholder="전화번호 -없이 입력"
/>
<p className="mt-6 text-[16px] font-normal leading-6">이메일</p>
<Input
className="mt-2"
type="text"
value={email}
onChange={handleEmailChange}
placeholder="예) [email protected]"
/>
<p className="mt-6 text-[16px] font-normal leading-6">성별</p>
<TwoOptionBox
option1={Gender[0].toString()}
Expand Down

0 comments on commit b5c7f07

Please sign in to comment.