Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/pages/notification/notification-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/profile/profile-description/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}회`,
},
];

Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/profile/profile-follows-badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-user/use-user-delete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-user/use-user-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/mock/service/user/users-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
39 changes: 18 additions & 21 deletions src/mock/service/user/users-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,48 @@ import { User } from '@/types/service/user';

export const mockUserItems: User[] = [
{
id: 1,
userId: 1,
email: '[email protected]',
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: '[email protected]',
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: '[email protected]',
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,
},
];
17 changes: 7 additions & 10 deletions src/types/service/user.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -25,7 +23,6 @@ export interface UpdateMePayload {
nickName?: string;
profileImage?: string;
mbti?: string;
phoneNumber?: string;
profileMessage?: string;
}

Expand Down