Rework 内容审核 pages around reported resources instead of individual reports, matching the new backend endpoints: rows group all reports on one comment/event, with a slide-over listing report details and per-row actions 通过并屏蔽 (approve) / 驳回举报 (reject) / 撤销屏蔽 (revert). Filters: 待处理 / 已屏蔽 / 全部. Co-Authored-By: Claude Fable 5 <[email protected]>
15 lines
547 B
TypeScript
15 lines
547 B
TypeScript
import { api } from '@/api/client'
|
|
import type { ApiResponse, ListParams, PaginatedResponse, ReportedComment } from '@/api/types'
|
|
|
|
const BASE = '/api/admin/v1/comments'
|
|
|
|
export type ModerationAction = 'approve' | 'reject' | 'revert'
|
|
|
|
export function fetchReportedComments(params: ListParams) {
|
|
return api.get<PaginatedResponse<ReportedComment>>(`${BASE}/reported`, params)
|
|
}
|
|
|
|
export function moderateReportedComment(id: number, action: ModerationAction) {
|
|
return api.patch<ApiResponse<ReportedComment>>(`${BASE}/reported/${id}`, { action })
|
|
}
|