18 lines
509 B
TypeScript
18 lines
509 B
TypeScript
|
|
import client from '../client'
|
||
|
|
import type { HistoryListResponse } from '../types/history'
|
||
|
|
|
||
|
|
export interface HistoryListQuery {
|
||
|
|
page?: number
|
||
|
|
per_page?: number
|
||
|
|
search?: string
|
||
|
|
sort?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export function fetchHistoryList(params: HistoryListQuery) {
|
||
|
|
return client.get<HistoryListResponse>('/api/history', { params }).then((r) => r.data)
|
||
|
|
}
|
||
|
|
|
||
|
|
export function deleteHistoryItem(id: number) {
|
||
|
|
return client.delete<{ success: boolean; message?: string }>(`/api/history/${id}`).then((r) => r.data)
|
||
|
|
}
|