File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 라우터 패턴
1319export 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// 게시글 생성
2452export interface CreatePostRequest {
2553 title : string ;
You can’t perform that action at this time.
0 commit comments