Skip to content

Commit 6059368

Browse files
authored
feat : 신고 등록 API + ReportModal 수정 (#111)
1 parent 74ef07b commit 6059368

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/ReportModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const ReportModal = ({ reportType, letterId, onClose }: ReportModalProps) => {
2929
reportType: reportType,
3030
reasonType: '',
3131
reason: '',
32-
letterId: letterId,
32+
letterId: reportType === 'LETTER' ? letterId : null,
33+
sharePostId: reportType === 'SHARE_POST' ? letterId : null,
34+
eventCommentId: reportType === 'EVENT_COMMENT' ? letterId : null,
3335
});
3436

3537
const handleReasonClick = (reason: Reason) => {

src/types/admin.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type Status = 'PENDING' | 'RESOLVED' | 'REJECTED';
2-
type ReportType = 'LETTER' | 'POST' | 'COMMENT';
2+
type ReportType = 'LETTER' | 'SHARE_POST' | 'EVENT_COMMENT';
33
type Reason = 'ABUSE' | 'DEFAMATION' | 'HARASSMENT' | 'THREATS' | 'ETC';
44

55
interface ReportQueryString {
@@ -41,6 +41,8 @@ interface PostReportRequest {
4141
reasonType: Reason | '';
4242
reason: string;
4343
letterId: number | null;
44+
sharePostId: number | null;
45+
eventCommentId: number | null;
4446
}
4547

4648
interface PatchReportRequest {

0 commit comments

Comments
 (0)