feat(moderation): comment/event report and dimzou translation pages
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 <[email protected]>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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 })
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { api } from '@/api/client'
|
||||
import type {
|
||||
ApiResponse,
|
||||
DimzouTranslation,
|
||||
ListParams,
|
||||
PaginatedResponse,
|
||||
RetranslateResult,
|
||||
} from '@/api/types'
|
||||
|
||||
const BASE = '/api/admin/v1/dimzou'
|
||||
|
||||
export function fetchDimzouTranslations(params: ListParams) {
|
||||
return api.get<PaginatedResponse<DimzouTranslation>>(`${BASE}/translations`, params)
|
||||
}
|
||||
|
||||
export function retranslate(id: number) {
|
||||
return api.post<ApiResponse<RetranslateResult>>(`${BASE}/translations/${id}/retranslate`)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { api } from '@/api/client'
|
||||
import type { ApiResponse, FileXEventReport, ListParams, PaginatedResponse } from '@/api/types'
|
||||
|
||||
const BASE = '/api/admin/v1/file-x'
|
||||
|
||||
export type EventReportAction = 'hide' | 'delete' | 'resolve' | 'dismiss'
|
||||
|
||||
export function fetchEventReports(params: ListParams) {
|
||||
return api.get<PaginatedResponse<FileXEventReport>>(`${BASE}/event-reports`, params)
|
||||
}
|
||||
|
||||
export function handleEventReport(id: number, action: EventReportAction) {
|
||||
return api.patch<ApiResponse<FileXEventReport>>(`${BASE}/event-reports/${id}`, { action })
|
||||
}
|
||||
Reference in New Issue
Block a user