21 lines
685 B
TypeScript
21 lines
685 B
TypeScript
import api from './client'
|
|
import type { ApiResponse, TrashListParams, TrashListResponse } from '@/types'
|
|
|
|
export class TrashService {
|
|
static async list(params: TrashListParams): Promise<ApiResponse<TrashListResponse>> {
|
|
return api.get('/admin/trash/list', { params })
|
|
}
|
|
|
|
static async restore(id: number): Promise<ApiResponse> {
|
|
return api.post('/admin/trash/restore', { id })
|
|
}
|
|
|
|
static async purge(id: number): Promise<ApiResponse> {
|
|
return api.delete('/admin/trash/purge', { data: { id } })
|
|
}
|
|
|
|
static async updateRetention(id: number, retentionDays: number): Promise<ApiResponse> {
|
|
return api.post('/admin/trash/retention', { id, retentionDays })
|
|
}
|
|
}
|