diff --git a/src/components/pages/notification/notification-card/index.tsx b/src/components/pages/notification/notification-card/index.tsx index d55f03c9..8cbfb029 100644 --- a/src/components/pages/notification/notification-card/index.tsx +++ b/src/components/pages/notification/notification-card/index.tsx @@ -77,9 +77,9 @@ const getDescription = (data: Notification) => { const getRoute = (data: Notification) => { switch (data.type) { case 'follow': - return `/profile/${data.user.id}`; + return `/profile/${data.user.userId}`; case 'group-create': - return `/profile/${data.user.id}`; + return `/profile/${data.user.userId}`; case 'group-delete': return ``; case 'group-join': diff --git a/src/components/pages/profile/profile-description/index.tsx b/src/components/pages/profile/profile-description/index.tsx index ce88a0d3..bad483f2 100644 --- a/src/components/pages/profile/profile-description/index.tsx +++ b/src/components/pages/profile/profile-description/index.tsx @@ -32,12 +32,12 @@ export const ProfileDescription = ({ user }: Props) => { { label: '모임 참여', iconId: 'users-2', - value: `${user.joinedCount}회`, + value: `${user.groupJoinedCnt}회`, }, { label: '모임 생성', iconId: 'map-pin-2', - value: `${user.createdCount}회`, + value: `${user.groupCreatedCnt}회`, }, ]; diff --git a/src/components/pages/profile/profile-follows-badge/index.tsx b/src/components/pages/profile/profile-follows-badge/index.tsx index 17e9d8f7..bf1c384a 100644 --- a/src/components/pages/profile/profile-follows-badge/index.tsx +++ b/src/components/pages/profile/profile-follows-badge/index.tsx @@ -10,11 +10,11 @@ export const ProfileFollowsBadge = ({ user }: Props) => { const listMap = [ { label: '팔로워', - value: user.followersCount, + value: user.followersCnt, }, { label: '팔로잉', - value: user.followeesCount, + value: user.followeesCnt, }, ]; diff --git a/src/hooks/use-user/use-user-delete/index.ts b/src/hooks/use-user/use-user-delete/index.ts index 0ea11eac..bef8abf8 100644 --- a/src/hooks/use-user/use-user-delete/index.ts +++ b/src/hooks/use-user/use-user-delete/index.ts @@ -8,7 +8,7 @@ export const useDeleteUser = () => { const query = useMutation({ mutationFn: () => API.userService.deleteMe(), onSuccess: (data, _variables, _context) => { - queryClient.invalidateQueries({ queryKey: userKeys.item(data.id) }); + queryClient.invalidateQueries({ queryKey: userKeys.item(data.userId) }); console.log('요청 성공'); }, onError: () => { diff --git a/src/hooks/use-user/use-user-update/index.ts b/src/hooks/use-user/use-user-update/index.ts index a06e3ad4..98e6c461 100644 --- a/src/hooks/use-user/use-user-update/index.ts +++ b/src/hooks/use-user/use-user-update/index.ts @@ -9,7 +9,7 @@ export const useUpdateUser = (payload: UpdateMePayload) => { const query = useMutation({ mutationFn: () => API.userService.updateMe(payload), onSuccess: (data, _variables, _context) => { - queryClient.invalidateQueries({ queryKey: userKeys.item(data.id) }); + queryClient.invalidateQueries({ queryKey: userKeys.item(data.userId) }); console.log('요청 성공'); }, onError: () => { diff --git a/src/mock/service/user/users-handler.ts b/src/mock/service/user/users-handler.ts index d1eb26bc..3180bf08 100644 --- a/src/mock/service/user/users-handler.ts +++ b/src/mock/service/user/users-handler.ts @@ -7,7 +7,7 @@ import { mockUserItems } from './users-mock'; const getUserItemMock = http.get(`*/users/:userId`, ({ params }) => { const id = Number(params.userId); - const user = mockUserItems.find((item) => item.id === id); + const user = mockUserItems.find((item) => item.userId === id); if (!user) { return HttpResponse.json( diff --git a/src/mock/service/user/users-mock.ts b/src/mock/service/user/users-mock.ts index 8f416c5e..c9bdcb04 100644 --- a/src/mock/service/user/users-mock.ts +++ b/src/mock/service/user/users-mock.ts @@ -2,51 +2,48 @@ import { User } from '@/types/service/user'; export const mockUserItems: User[] = [ { - id: 1, + userId: 1, email: 'test@example.com', nickName: '리오넬 메시', profileImage: 'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', - notification_enabled: true, + isNotificationEnabled: true, mbti: 'ISTJ', - phoneNumber: '010-1234-5678', profileMessage: 'Zzz...', - followeesCount: 102356, - followersCount: 104, + followeesCnt: 102356, + followersCnt: 104, createdAt: '2025-12-07T17:00:00+09:00', - joinedCount: 5, - createdCount: 3, + groupJoinedCnt: 5, + groupCreatedCnt: 3, }, { - id: 2, + userId: 2, email: 'test@example.com', nickName: '크리스티아누 호날두', profileImage: 'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', - notification_enabled: false, + isNotificationEnabled: false, mbti: 'ENFP', - phoneNumber: '010-1234-5678', profileMessage: '안녕하세요', - followeesCount: 7056512, - followersCount: 134, + followeesCnt: 7056512, + followersCnt: 134, createdAt: '2025-08-03T17:00:00+09:00', - joinedCount: 5, - createdCount: 3, + groupJoinedCnt: 5, + groupCreatedCnt: 3, }, { - id: 3, + userId: 3, email: 'test@example.com', nickName: '페르난도 토레스', profileImage: 'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', - notification_enabled: true, + isNotificationEnabled: true, mbti: 'ESFJ', - phoneNumber: '010-1234-5678', profileMessage: '반갑습니다', - followeesCount: 15, - followersCount: 12, + followeesCnt: 15, + followersCnt: 12, createdAt: '2025-11-03T17:00:00+09:00', - joinedCount: 2, - createdCount: 1, + groupJoinedCnt: 2, + groupCreatedCnt: 1, }, ]; diff --git a/src/types/service/user.ts b/src/types/service/user.ts index 2fe7616a..3fcff71f 100644 --- a/src/types/service/user.ts +++ b/src/types/service/user.ts @@ -1,18 +1,16 @@ export interface User { - id: number; + userId: number; email: string; nickName: string; - profileImage: string; - notification_enabled: boolean; mbti: string; - phoneNumber: string; // 삭제 + profileImage: string; profileMessage: string; - // 아래는 추가되어야 할 것들 - followeesCount: number; - followersCount: number; + followeesCnt: number; + followersCnt: number; + groupJoinedCnt: number; + groupCreatedCnt: number; + isNotificationEnabled: boolean; createdAt: string; - joinedCount: number; - createdCount: number; } export interface GetUserPayload { @@ -25,7 +23,6 @@ export interface UpdateMePayload { nickName?: string; profileImage?: string; mbti?: string; - phoneNumber?: string; profileMessage?: string; }