Skip to content

Commit 3bbee65

Browse files
authored
Merge pull request #303 from Bamdoliro/develop
Release - user v1.1.0
2 parents a4ceb6a + 6c63d91 commit 3bbee65

File tree

26 files changed

+466
-358
lines changed

26 files changed

+466
-358
lines changed

apps/user/src/apis/token/refresh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TOKEN, ROUTES } from '@/constants/common/constant';
1+
import { ROUTES, TOKEN } from '@/constants/common/constant';
22
import { maru } from '../instance/instance';
33
import { Storage } from '../storage/storage';
44

@@ -9,7 +9,7 @@ const refreshToken = async () => {
99
'Refresh-Token': `${Storage.getItem(TOKEN.REFRESH)}`,
1010
},
1111
});
12-
Storage.setItem(TOKEN.ACCESS, data.accessToken);
12+
Storage.setItem(TOKEN.ACCESS, data.data.accessToken);
1313
} catch {
1414
window.location.href = ROUTES.LOGIN;
1515
alert('다시 로그인 해주세요');

apps/user/src/app/form/보호자정보/보호자정보.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FindAddressModal, FormController } from '@/components/form';
22
import { FormLayout } from '@/layouts';
33
import { useFormValueStore } from '@/store';
4-
import { ButtonInput, Column, Input, Row } from '@maru/ui';
4+
import { ButtonInput, Column, Input, RadioGroup, Row } from '@maru/ui';
55
import { useOverlay } from '@toss/use-overlay';
66
import styled from 'styled-components';
77
import { useCTAButton, useInput } from './보호자정보.hooks';
@@ -53,6 +53,33 @@ const 보호자정보 = () => {
5353
isError={form.parent.address.length > 100}
5454
errorMessage="100자 이하여야 합니다."
5555
/>
56+
<Row justifyContent="flex-start" alignItems="center">
57+
<RadioGroup
58+
label="보호자 관계"
59+
value={form.parent.relation}
60+
onChange={handle보호자정보DataChange}
61+
name="relation"
62+
list={[
63+
{ label: '부', value: '아빠' },
64+
{ label: '모', value: '엄마' },
65+
{
66+
label: '기타',
67+
value: '기타',
68+
checked:
69+
form.parent.relation !== '아빠' &&
70+
form.parent.relation !== '엄마',
71+
},
72+
]}
73+
/>
74+
</Row>
75+
{form.parent.relation !== '아빠' && form.parent.relation !== '엄마' && (
76+
<Input
77+
value={form.parent.relation}
78+
onChange={handle보호자정보DataChange}
79+
name="relation"
80+
/>
81+
)}
82+
5683
<Row gap={48}>
5784
<Input
5885
name="detailAddress"

apps/user/src/app/form/성적입력/성적입력.hooks.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
import { useSaveFormMutation } from '@/services/form/mutations';
2-
import {
3-
useSetFormStepStore,
4-
useNewSubjectValueStore,
5-
useSubjectValueStore,
6-
useFormValueStore,
7-
} from '@/store';
2+
import { useFormValueStore, useSetFormStepStore } from '@/store';
83

94
export const useCTAButton = () => {
105
const form = useFormValueStore();
116
const setFormStep = useSetFormStepStore();
12-
const newSubjectList = useNewSubjectValueStore();
13-
const subjectList = useSubjectValueStore();
147
const { saveFormMutate } = useSaveFormMutation();
158

16-
const studentSubjectList = [...subjectList, ...newSubjectList].map(({ id, ...rest }) => rest);
17-
189
const handleNextButtonClick = () => {
1910
setFormStep('자기소개서');
20-
saveFormMutate({ ...form, grade: { ...form.grade, subjectList: studentSubjectList } });
11+
saveFormMutate(form);
2112
};
2213

2314
const handlePreviousButtonClick = () => {

apps/user/src/app/form/전형선택/전형선택.tsx

Lines changed: 212 additions & 189 deletions
Large diffs are not rendered by default.

apps/user/src/app/form/초안작성완료/초안작성완료.hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const useCheckFilledForm = () => {
9090

9191
if (
9292
filledApplicantFieldsCount === 5 &&
93-
filledParentFieldsCount === 5 &&
93+
filledParentFieldsCount === 6 &&
9494
filledEducationFieldsCount === 8 &&
9595
filledTypeFieldsCount === 1 &&
9696
filledDocumentFieldsCount === 2

apps/user/src/app/login/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
'use client';
22

3-
import { ROUTES } from '@/constants/common/constant';
43
import { AppLayout } from '@/layouts';
54
import { IconArrowRight } from '@maru/icon';
65
import { color, font } from '@maru/theme';
76
import { Button, Column, Input, PreviewInput } from '@maru/ui';
87
import { flex } from '@maru/utils';
98
import Image from 'next/image';
10-
import { useCTAButton, useInput, useLoginAction } from './login.hooks';
119
import styled from 'styled-components';
10+
import { useCTAButton, useInput, useLoginAction } from './login.hooks';
1211

1312
const LoginPage = () => {
1413
const { handleGoSingUpPageButtonClick, handleGoMainPageButtonClick } = useCTAButton();
@@ -31,7 +30,7 @@ const LoginPage = () => {
3130
<Column gap="36px" width="100%">
3231
<Column gap="24px">
3332
<Input
34-
label="아이디"
33+
label="이메일"
3534
width="100%"
3635
name="email"
3736
onChange={handleLoginUserDataChange}

apps/user/src/app/signup/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const SignUpPage = () => {
4040
name="name"
4141
placeholder="이름을 입력해주세요."
4242
onChange={handleJoinUserDataChange}
43+
isError={joinUserData.name.length === 0}
44+
errorMessage="필수값입니다."
4345
/>
4446
<ButtonInput
4547
label="이메일 인증"
@@ -61,17 +63,17 @@ const SignUpPage = () => {
6163
label="인증코드"
6264
width="100%"
6365
maxLength={6}
64-
errorMessage="발송된 이메일의 인증번호를 입력해주세요."
6566
name="code"
6667
onChange={handleJoinUserDataChange}
6768
timerTime={timerTime}
6869
setTimerTime={setTimerTime}
70+
isError={joinUserData.code.length < 6}
71+
errorMessage="발송된 이메일의 인증번호를 입력해주세요."
6972
/>
7073
)}
7174
<PreviewInput
7275
label="비밀번호"
7376
width="100%"
74-
errorMessage="8~16자의 영문 대소문자, 숫자, 특수문자만 가능합니다."
7577
name="password"
7678
onChange={handleJoinUserDataChange}
7779
/>
@@ -80,6 +82,8 @@ const SignUpPage = () => {
8082
width="100%"
8183
name="password_confirm"
8284
onChange={handleJoinUserDataChange}
85+
isError={joinUserData.password !== joinUserData.password_confirm}
86+
errorMessage="비밀번호가 맞지 않습니다."
8387
/>
8488
</Column>
8589
{/* 이용약관 동의 */}

apps/user/src/components/form/Calculators/CertificateCalculator/CertificateCalculator.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const CertificateCalculator = () => {
3030
},
3131
}));
3232
}
33-
console.log(form);
3433
};
3534

3635
return (

apps/user/src/components/form/Calculators/GradeCalculator/GradeCalculator.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useNewSubjectStore, useSubjectStore } from '@/store';
1+
import { useNewSubjectStore, useSetFormStore, useSubjectStore } from '@/store';
22
import { Subject } from '@/types/form/client';
33
import { color, font } from '@maru/theme';
44
import { Button, Column } from '@maru/ui';
@@ -12,6 +12,7 @@ import NewGradeCalculatorItem from './NewGradeCalculatorItem/NewGradeCalculatorI
1212
const GradeCalculator = () => {
1313
const [newSubjectList, setNewSubjectList] = useNewSubjectStore();
1414
const [subjectList, setSubjectList] = useSubjectStore();
15+
const setForm = useSetFormStore();
1516
const footerRef = useRef<HTMLDivElement>(null);
1617
const isMount = useRef(true);
1718

@@ -35,6 +36,14 @@ const GradeCalculator = () => {
3536
if (newSubjectList.length) footerRef.current?.scrollIntoView();
3637
}, [newSubjectList]);
3738

39+
useEffect(() => {
40+
const studentSubjectList = [...subjectList, ...newSubjectList].map(
41+
({ id, ...rest }) => rest,
42+
);
43+
44+
setForm((prev) => ({ ...prev, grade: { ...prev.grade, subjectList: studentSubjectList } }));
45+
}, [newSubjectList, subjectList]);
46+
3847
return (
3948
<StyledGradeCalculator>
4049
<Desc>

apps/user/src/components/form/ProfileUploader/ProfileUploader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const ProfileUploader = () => {
9191
</Button>
9292
)}
9393
<Desc>
94-
20MB 이하, 3개월 이내의
94+
10MB 이하, 3개월 이내의
9595
<br />
9696
3x4 cm 증명사진
9797
</Desc>

0 commit comments

Comments
 (0)