Skip to content

Commit 5dac018

Browse files
committed
Fix: 충돌 해결
2 parents abafd2f + 1bd1d97 commit 5dac018

35 files changed

Lines changed: 417 additions & 759 deletions

File tree

src/apis/auth/dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BaseSuccessResponse } from '../core/dto';
44
export type getUserInfoByJwtResponse = BaseSuccessResponse<getUserInfoByJwtData>;
55
// jwt를 이용한 사용자 정보 조회 응답 데이터
66
export interface getUserInfoByJwtData {
7-
userId: string;
7+
userId: number;
88
name: string;
99
phoneNumber: string;
1010
email: string;

src/apis/user-block/dto.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// 차단/해제 요청 데이터
2+
export interface PostUserBlockRequest {
3+
fromUserId: number;
4+
toUserId: number;
5+
action: 'block' | 'unblock'; // 차단 또는 해제
6+
}

src/apis/user-block/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { PostUserBlockRequest } from './dto';
2+
import { EmptySuccessResponse } from '../core/dto';
3+
import { newRequest } from '../core';
4+
5+
// 유저 차단 api
6+
export const postUserBlockApi = (data: PostUserBlockRequest) =>
7+
newRequest.post<EmptySuccessResponse>('/user-block', data);

src/apis/user-report/dto.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// 사용자 신고 요청 데이터
2+
export interface PostUserReportRequest {
3+
fromUserId: number;
4+
toUserId: number;
5+
reason: string;
6+
}

src/apis/user-report/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { PostUserReportRequest } from './dto';
2+
import { EmptySuccessResponse } from '../core/dto';
3+
import { newRequest } from '../core';
4+
5+
// 유저 신고 api
6+
export const postUserReportApi = (data: PostUserReportRequest) =>
7+
newRequest.post<EmptySuccessResponse>('/user-report', data);

src/apis/user/dto.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,20 @@ import { BaseSuccessResponse } from '../core/dto';
22

33
// 사용자 정보 공통 인터페이스
44
export interface UserInfoData {
5-
userId: number;
6-
name: string;
7-
phoneNumber: string;
8-
email: string;
9-
nickname: string;
10-
profilePictureUrl: string;
11-
bio: string;
12-
joinedAt?: string; // user 공통 인터페이스에 이 두 개는 안 나와있어서 일단 이것들만 optional 처리했습니다...
13-
isFriend: boolean;
5+
userId: number;
6+
name: string;
7+
phoneNumber: string;
8+
email: string;
9+
nickname: string;
10+
profilePictureUrl: string;
11+
bio: string;
12+
birthDate: string; // user 공통 인터페이스에 이 두 개는 안 나와있어서 일단 이것들만 optional 처리했습니다...
13+
isFriend: boolean;
1414
}
1515

1616
// 사용자 정보 조회 응답
1717
export type GetUserInfoResponse = BaseSuccessResponse<UserInfoData>;
1818

19-
// 사용자 신고 요청 데이터
20-
export interface PostUserReportRequest {
21-
fromUserId: number;
22-
toUserId: number;
23-
reason: string;
24-
}
25-
26-
// 차단/해제 요청 데이터
27-
export interface PostUserBlockRequest {
28-
fromUserId: number;
29-
toUserId: number;
30-
action: 'block' | 'unblock'; // 차단 또는 해제
31-
}
32-
3319
// 사용자 정보 수정 응답
3420
export type PatchUserInfoResponse = BaseSuccessResponse<UserInfoData>;
3521

src/apis/user/index.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
1-
import {
2-
GetUserInfoResponse,
3-
PostUserBlockRequest,
4-
PostUserReportRequest,
5-
PatchUserInfoRequest,
6-
PatchUserInfoResponse,
7-
PatchUserWithDrawResponse,
8-
} from './dto';
1+
import { GetUserInfoResponse, PatchUserInfoRequest, PatchUserInfoResponse, PatchUserWithDrawResponse } from './dto';
92
import { newRequest } from '../core';
103
import { EmptySuccessResponse } from '../core/dto';
114

125
// 유저 정보 수정 api
13-
export const patchUserInfoApi = (data: PatchUserInfoRequest, userId: string) =>
6+
export const patchUserInfoApi = (data: PatchUserInfoRequest, userId: number) =>
147
newRequest.patch<PatchUserInfoResponse>(`/user/${userId}`, data);
158

169
// 유저 탈퇴 api
17-
export const patchUserWithdrawApi = (userId: string) =>
10+
export const patchUserWithdrawApi = (userId: number) =>
1811
newRequest.patch<PatchUserWithDrawResponse>(`/user/${userId}/withdraw`);
1912

20-
// 유저 차단 api
21-
export const postUserBlockApi = (data: PostUserBlockRequest) =>
22-
newRequest.post<EmptySuccessResponse>('/user-block', data);
23-
24-
// 유저 신고 api
25-
export const postUserReportApi = (data: PostUserReportRequest) =>
26-
newRequest.post<EmptySuccessResponse>('/user-report', data);
27-
2813
// 이용 약관 동의 api
29-
export const postTermsAgreementApi = (userId: string) => newRequest.post<EmptySuccessResponse>(`/user/${userId}`);
14+
export const postTermsAgreementApi = (userId: number) => newRequest.post<EmptySuccessResponse>(`/user/${userId}`);
3015

3116
// 유저 정보 조회 api
32-
export const getUserInfoApi = (userId: number) => newRequest.get<GetUserInfoResponse>(`/user/${userId}`);
17+
export const getUserInfoApi = (userId: number) => newRequest.get<GetUserInfoResponse>(`/user/${userId}`);

src/components/BottomSheet/OptionsBottomSheet/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { BottomSheetMenuProps } from '../../BottomSheetMenu/dto';
1010
import { ReportBottomSheetMenuProps } from './ReportBottomSheetMenu/dto';
1111
import { ModalProps } from '../../Modal/dto';
1212

13+
import { SendPostReportRequest } from '../../../apis/post-report/dto';
14+
import { PostUserReportRequest } from '../../../apis/user-report/dto';
15+
import { PostUserBlockRequest } from '../../../apis/user-block/dto';
16+
1317
import { StyledText } from '../../Text/StyledText';
1418
import { handleError } from '../../../apis/util/handleError';
1519
import blockIcon from '../../../assets/default/block.svg';
@@ -25,10 +29,9 @@ import {
2529
ReportModalBox,
2630
} from './styles';
2731
import theme from '../../../styles/theme';
28-
import { postUserBlockApi, postUserReportApi } from '../../../apis/user';
29-
import { PostUserBlockRequest, PostUserReportRequest } from '../../../apis/user/dto';
32+
import { postUserBlockApi } from '../../../apis/user-block';
33+
import { postUserReportApi } from '../../../apis/user-report';
3034
import { sendPostReportApi } from '../../../apis/post-report';
31-
import { SendPostReportRequest } from '../../../apis/post-report/dto';
3235

3336
const OptionsBottomSheet: React.FC<OptionsBottomSheetProps> = ({
3437
domain,

src/components/PostBase/LikeCommentBottomSheetContent/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import Report from '../../../assets/default/report.svg';
2828
import X from '../../../assets/default/x.svg';
2929

3030
import { getPostLikeListApi } from '../../../apis/post-like';
31-
import { postUserBlockApi } from '../../../apis/user';
32-
import { PostUserBlockRequest } from '../../../apis/user/dto';
33-
import { createCommentApi, getCommentListApi, deleteCommentApi } from '../../../apis/post-comment';
31+
import { postUserBlockApi } from '../../../apis/user-block';
32+
import { PostUserBlockRequest } from '../../../apis/user-block/dto';
33+
import { createCommentApi, deleteCommentApi, getCommentListApi } from '../../../apis/post-comment';
3434
import { handleError } from '../../../apis/util/handleError';
3535

3636
const LikeCommentBottomSheetContent: React.FC<LikeCommentBottomSheetProps> = ({ tab, likeCount, commentCount }) => {

src/components/PostItem/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import { PostItemProps } from './dto';
1717

1818
const PostItem: React.FC<PostItemProps> = ({ post, isMyPost = true }) => {
1919
const navigate = useNavigate();
20-
const commentsCount = post.postCommentsCount ?? 0; // 현재 api 응답에 commentsCount가 없어 undefine 오류 해결 위해 설정, 추후 api 수정되면 삭제 해도 되는 행
21-
const imageUrl = post.imageUrl || 'https://via.placeholder.com/72';
20+
const imageUrl = post.imageUrl;
2221

2322
const handleClick = () => {
2423
const path = isMyPost ? `/my-post/${post.id}` : `/post/${post.id}`;
@@ -37,7 +36,7 @@ const PostItem: React.FC<PostItemProps> = ({ post, isMyPost = true }) => {
3736
</LikesCountStyledText>
3837
<Icon src={MessageSvg} alt="message icon" />
3938
<LikesCountStyledText $textTheme={{ style: 'caption1-regular' }} color={theme.colors.gray3}>
40-
{commentsCount}
39+
{post.postCommentsCount}
4140
</LikesCountStyledText>
4241
</LikesOverlay>
4342
</PostImageContainer>

0 commit comments

Comments
 (0)