New 内容审核 nav group covering the remaining admin API groups: - /comment-reports — status filter; hide/delete comment or dismiss - /event-reports — status filter; hide/delete/resolve/dismiss - /dimzou-translations — language/status filters, draft block progress, requeue machine translation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15 lines
537 B
TypeScript
15 lines
537 B
TypeScript
import { api } from '@/api/client'
|
|
import type { ApiResponse, CommentReport, ListParams, PaginatedResponse } from '@/api/types'
|
|
|
|
const BASE = '/api/admin/v1/comments'
|
|
|
|
export type CommentReportAction = 'hide' | 'delete' | 'dismiss'
|
|
|
|
export function fetchCommentReports(params: ListParams) {
|
|
return api.get<PaginatedResponse<CommentReport>>(`${BASE}/reports`, params)
|
|
}
|
|
|
|
export function handleCommentReport(id: number, action: CommentReportAction) {
|
|
return api.patch<ApiResponse<CommentReport>>(`${BASE}/reports/${id}`, { action })
|
|
}
|