Skip to content

Commit

Permalink
[유저] 학부를 선택해도 반영되지 않는 이슈 (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwak-Seungju authored Nov 25, 2024
1 parent c26d693 commit 6ad375e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/pages/Auth/ModifyInfoPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,10 @@ const MajorInput = React.forwardRef<ICustomFormInput, ICustomFormInputProps>((pr

React.useImperativeHandle<ICustomFormInput | null, ICustomFormInput | null>(ref, () => {
let valid: string | true = '오류가 발생했습니다';
if (!studentNumber) {
return {
value: '',
valid: true,
};
}
const year = parseInt(studentNumber.slice(0, 4), 10);
if (year < 1992 || year > new Date().getFullYear()) {
valid = '올바른 입학년도가 아닙니다.';
} else if (studentNumber.length !== 10) {
} else if (studentNumber && studentNumber.length !== 10) {
valid = '학번은 10자리여야 합니다.';
} else {
valid = true;
Expand Down
8 changes: 1 addition & 7 deletions src/pages/Auth/SignupPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,10 @@ const MajorInput = React.forwardRef<ICustomFormInput, ICustomFormInputProps>((pr

React.useImperativeHandle<ICustomFormInput | null, ICustomFormInput | null>(ref, () => {
let valid: string | true = '오류가 발생했습니다';
if (!studentNumber) {
return {
value: '',
valid: true,
};
}
const year = parseInt(studentNumber.slice(0, 4), 10);
if (year < 1992 || year > new Date().getFullYear()) {
valid = '올바른 입학년도가 아닙니다.';
} else if (studentNumber.length !== 10) {
} else if (studentNumber && studentNumber.length !== 10) {
valid = '학번은 10자리여야 합니다.';
} else {
valid = true;
Expand Down

0 comments on commit 6ad375e

Please sign in to comment.