Skip to content

Commit

Permalink
[FE][Fix] #59 : DTO 구조 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
juwon5272 committed Nov 27, 2024
1 parent 9578a90 commit 217cd08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 3 additions & 7 deletions frontend/src/api/dto/auth.dto.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
export class LoginResEntity {
data: {
token: string | undefined;
userId: string | undefined;
} = {
token: undefined,
userId: undefined,
};
token: string | undefined;

userId: string | undefined;
}

export class RegisterResEntity {
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/component/authmodal/AuthModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const AuthModal = (props: IAuthModalProps) => {
const handleLoginClick = () => {
doLogin(loginData.id, loginData.pw)
.then(el => {
if (el.data?.data.token && el.data?.data.userId) {
saveLocalData(AppConfig.KEYS.LOGIN_TOKEN, el.data?.data.token);
saveLocalData(AppConfig.KEYS.LOGIN_USER, el.data?.data.userId);
if (el.data?.token && el.data?.userId) {
saveLocalData(AppConfig.KEYS.LOGIN_TOKEN, el.data.token);
saveLocalData(AppConfig.KEYS.LOGIN_USER, el.data.userId);
}
setError('');
props.onClose();
Expand Down Expand Up @@ -109,6 +109,7 @@ export const AuthModal = (props: IAuthModalProps) => {
placeholder="PW"
value={loginData.pw}
onChange={handleChange}
type="password"
/>
{error ? <p className="pt-2 text-sm font-normal text-red-500">{error}</p> : ''}
<Modal.Footer
Expand Down Expand Up @@ -148,13 +149,15 @@ export const AuthModal = (props: IAuthModalProps) => {
placeholder="사용할 비밀번호를 입력해주세요."
value={registerData.pw}
onChange={handleChange}
type="password"
/>
<Modal.Input
title=""
name="confirmPw"
placeholder="비밀번호를 한 번 더 입력해주세요."
value={registerData.confirmPw}
onChange={handleChange}
type="password"
/>
{error ? <p className="pt-2 text-sm font-normal text-red-500">{error}</p> : ''}

Expand Down

0 comments on commit 217cd08

Please sign in to comment.