15 lines
455 B
TypeScript
15 lines
455 B
TypeScript
import type { ApiResponse } from "@/lib/api"
|
|
import type { ScoreItem } from "@/lib/models/funds"
|
|
import { phpPost } from "./http"
|
|
|
|
export async function fetchScoreList(
|
|
page: number,
|
|
): Promise<ApiResponse<ScoreItem[]>> {
|
|
const res = await phpPost<ScoreItem[] | unknown>("/user/UserScore/getList", {
|
|
cookie: document.cookie,
|
|
page,
|
|
})
|
|
if (!res.success) return res
|
|
return { success: true, data: Array.isArray(res.data) ? res.data : [] }
|
|
}
|