Skip to content

Commit 12fe603

Browse files
committed
Merge branch 'dev' of https://github.com/oodd-team/oodd-web-react into feat/OD-158
2 parents 45fef86 + 787c9ff commit 12fe603

8 files changed

Lines changed: 25 additions & 19 deletions

File tree

src/apis/auth/dto.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { BaseSuccessResponse } from '../core/dto';
1+
import type { BaseSuccessResponse } from '@apis/core/dto';
22

33
// jwt를 이용한 사용자 정보 조회 응답
44
export type getUserInfoByJwtResponse = BaseSuccessResponse<getUserInfoByJwtData>;
55
// jwt를 이용한 사용자 정보 조회 응답 데이터
66
export interface getUserInfoByJwtData {
7-
userId: number;
7+
id: number;
88
name: string;
99
phoneNumber: string;
1010
email: string;
1111
nickname: string;
1212
profilePictureUrl: string;
1313
bio: string;
14+
birthDate: string;
1415
}

src/apis/auth/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getUserInfoByJwtResponse } from './dto';
2-
import { newRequest } from '../core';
1+
import { newRequest } from '@apis/core';
2+
import type { getUserInfoByJwtResponse } from './dto';
33

44
// jwt로 사용자 정보 조회 api /auth/me
55
export const getUserInfoByJwtApi = () => newRequest.get<getUserInfoByJwtResponse>('/auth/me');

src/apis/user-block/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EmptySuccessResponse } from '@apis/core/dto';
21
import { newRequest } from '@apis/core';
2+
import type { EmptySuccessResponse } from '@apis/core/dto';
33
import type { PostUserBlockRequest } from './dto';
44

55
// 유저 차단 api

src/apis/user-report/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EmptySuccessResponse } from '@apis/core/dto';
21
import { newRequest } from '@apis/core';
2+
import type { EmptySuccessResponse } from '@apis/core/dto';
33
import type { PostUserReportRequest } from './dto';
44

55
// 유저 신고 api

src/apis/user/dto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { BaseSuccessResponse } from '../core/dto';
1+
import type { BaseSuccessResponse } from '@apis/core/dto';
22

33
// 사용자 정보 공통 인터페이스
44
export interface UserInfoData {
5-
userId: number;
5+
id: number;
66
name: string;
77
phoneNumber: string;
88
email: string;
99
nickname: string;
1010
profilePictureUrl: string;
1111
bio: string;
12-
birthDate: string; // user 공통 인터페이스에 이 두 개는 안 나와있어서 일단 이것들만 optional 처리했습니다...
12+
birthDate: string;
1313
isFriend: boolean;
1414
}
1515

@@ -37,5 +37,5 @@ export type PatchUserWithDrawResponse = BaseSuccessResponse<PatchUserWithdrawDat
3737
export interface PatchUserWithdrawData {
3838
isSuccess: boolean;
3939
code: string;
40-
data: Record<string, never>; // 탈퇴 성공 시 항상 빈 객체가 응답으로 온다면 Record<string, never>으로 타입 안정성 높일 수 있답니다
40+
data: Record<string, never>; // 탈퇴 성공 시 항상 빈 객체가 응답으로 온다면 Record<string, never>으로 타입 안정성 높일 수 있음
4141
}

src/apis/user/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { GetUserInfoResponse, PatchUserInfoRequest, PatchUserInfoResponse, PatchUserWithDrawResponse } from './dto';
2-
import { newRequest } from '../core';
3-
import { EmptySuccessResponse } from '../core/dto';
1+
import { newRequest } from '@apis/core';
2+
import type { EmptySuccessResponse } from '@apis/core/dto';
3+
import type {
4+
GetUserInfoResponse,
5+
PatchUserInfoRequest,
6+
PatchUserInfoResponse,
7+
PatchUserWithDrawResponse,
8+
} from './dto';
49

510
// 유저 정보 수정 api
611
export const patchUserInfoApi = (data: Partial<PatchUserInfoRequest>, userId: number) =>

src/pages/Login/LoginComplete/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ const LoginComplete: React.FC = () => {
4343
const response = await getUserInfoByJwtApi();
4444
console.log(response);
4545

46-
const { nickname, name, userId } = response.data;
47-
localStorage.setItem('current_user_id', `${userId}`);
46+
const { nickname, name, id } = response.data;
47+
localStorage.setItem('current_user_id', `${id}`);
4848

4949
if (nickname && name) {
5050
if (nickname && name) {
51-
const isAgreed = await hasAgreedToTerms(userId);
52-
navigate(isAgreed ? '/' : '/terms-agreement'); // 이용 약관이 필요하면 (false) 해당 페이지로 이동
51+
const isAgreed = await hasAgreedToTerms(id);
52+
navigate(isAgreed ? '/' : '/signup/terms-agreement'); // 이용 약관이 필요하면 (false) 해당 페이지로 이동
5353
}
5454
} else {
5555
navigate('/signup');

src/recoil/ProfileViewer/userDetailsAtom.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { atom } from 'recoil';
22
import type { UserInfoData } from '@apis/user/dto';
33
import imageBasic from '@assets/default/defaultProfile.svg';
44

5-
type BasicUserInfo = Pick<UserInfoData, 'userId' | 'nickname' | 'bio' | 'isFriend' | 'profilePictureUrl'>;
5+
type BasicUserInfo = Pick<UserInfoData, 'id' | 'nickname' | 'bio' | 'isFriend' | 'profilePictureUrl'>;
66

77
export const UserInfoAtom = atom<BasicUserInfo | null>({
88
key: 'UserInfoAtom',
99
default: {
10-
userId: -1,
10+
id: -1,
1111
nickname: '알 수 없음',
1212
bio: '',
1313
isFriend: false,

0 commit comments

Comments
 (0)