2026-08-14 16:30:41 +08:00
|
|
|
import type { ApiResponse } from "@/lib/api"
|
2026-08-31 14:49:28 +08:00
|
|
|
import type { LineData, LineSearchResult } from "@/lib/models/line"
|
|
|
|
|
import { phpGet } from "./http"
|
2026-08-18 13:33:22 +08:00
|
|
|
|
|
|
|
|
export function fetchLineData(product: number): Promise<ApiResponse<LineData>> {
|
2026-08-31 14:49:28 +08:00
|
|
|
return phpGet<LineData>(`/script/linedata/display.php?product=${product}`)
|
2026-08-14 16:30:41 +08:00
|
|
|
}
|
|
|
|
|
|
2026-08-18 13:33:22 +08:00
|
|
|
export function searchLineData(
|
2026-08-14 16:30:41 +08:00
|
|
|
productid: number,
|
|
|
|
|
info: string,
|
|
|
|
|
): Promise<ApiResponse<LineSearchResult>> {
|
|
|
|
|
const query = `type=0&productid=${productid}&info=${encodeURIComponent(info)}`
|
2026-08-31 14:49:28 +08:00
|
|
|
return phpGet<LineSearchResult>(`/script/linedata/search.php?${query}`)
|
2026-08-14 16:30:41 +08:00
|
|
|
}
|