Skip to content

Commit 439cef2

Browse files
junzero741claude
andcommitted
feat(shared): add report types and API routes
ReportReason 타입, CreateReportRequest 인터페이스, 신고/관리자 API 경로 추가. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 455d843 commit 439cef2

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

packages/shared/src/lib/api.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,51 @@ export const API_ROUTES = {
33
posts: {
44
create: '/posts',
55
unlock: (slug: string) => `/posts/${slug}/unlock`,
6+
report: (slug: string) => `/posts/${slug}/report`,
67
},
78
uploads: {
89
image: '/uploads/image',
910
},
11+
admin: {
12+
reports: '/admin/reports',
13+
deletePost: (slug: string) => `/admin/posts/${slug}`,
14+
dismissReport: (id: string) => `/admin/reports/${id}/dismiss`,
15+
},
1016
} as const;
1117

1218
// 백엔드용: Express 라우터 패턴
1319
export const ROUTE_PATTERNS = {
1420
posts: {
1521
create: '/',
1622
unlock: '/:slug/unlock',
23+
report: '/:slug/report',
1724
},
1825
uploads: {
1926
image: '/image',
2027
},
28+
admin: {
29+
reports: '/reports',
30+
deletePost: '/posts/:slug',
31+
dismissReport: '/reports/:id/dismiss',
32+
},
2133
} as const;
2234

35+
// 신고
36+
export type ReportReason =
37+
| 'ILLEGAL_CONTENT'
38+
| 'DEFAMATION'
39+
| 'PERSONAL_INFO'
40+
| 'PHISHING'
41+
| 'COPYRIGHT'
42+
| 'OTHER';
43+
44+
45+
export interface CreateReportRequest {
46+
slug: string;
47+
reason: ReportReason;
48+
description?: string;
49+
}
50+
2351
// 게시글 생성
2452
export interface CreatePostRequest {
2553
title: string;

0 commit comments

Comments
 (0)