feat(filex): add admin event monitoring
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { api } from '@/api/client'
|
||||
import type { ApiResponse, ListParams, PaginatedResponse, ReportedEvent } from '@/api/types'
|
||||
import type {
|
||||
ApiResponse,
|
||||
FileXAdminEvent,
|
||||
FileXAdminEventDetail,
|
||||
ListParams,
|
||||
PaginatedResponse,
|
||||
ReportedEvent,
|
||||
} from '@/api/types'
|
||||
import type { ModerationAction } from '@/api/modules/comments'
|
||||
|
||||
const BASE = '/api/admin/v1/file-x'
|
||||
@@ -11,3 +18,11 @@ export function fetchReportedEvents(params: ListParams) {
|
||||
export function moderateReportedEvent(id: number, action: ModerationAction) {
|
||||
return api.patch<ApiResponse<ReportedEvent>>(`${BASE}/reported-events/${id}`, { action })
|
||||
}
|
||||
|
||||
export function fetchFileXEvents(params: ListParams) {
|
||||
return api.get<PaginatedResponse<FileXAdminEvent>>(`${BASE}/events`, params)
|
||||
}
|
||||
|
||||
export function fetchFileXEvent(id: number) {
|
||||
return api.get<ApiResponse<FileXAdminEventDetail>>(`${BASE}/events/${id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user