(
topic: string,
outline: { raw: string; pages: Page[] },
taskId?: string
)
| 12 | import type { AppError } from '../utils/errors' |
| 13 | |
| 14 | export async function createHistory( |
| 15 | topic: string, |
| 16 | outline: { raw: string; pages: Page[] }, |
| 17 | taskId?: string |
| 18 | ): Promise<{ success: boolean; record_id?: string; error?: AppError | string; error_message?: string }> { |
| 19 | try { |
| 20 | const response = await axios.post( |
| 21 | `${API_BASE_URL}/history`, |
| 22 | { |
| 23 | topic, |
| 24 | outline, |
| 25 | task_id: taskId |
| 26 | }, |
| 27 | { |
| 28 | timeout: 10000 |
| 29 | } |
| 30 | ) |
| 31 | return response.data |
| 32 | } catch (error: any) { |
| 33 | return { success: false, ...getApiErrorPayload(error, '创建历史记录失败') } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | export async function getHistoryList( |
| 38 | page: number = 1, |
no test coverage detected