MCPcopy
hub / github.com/HisMax/RedInk / createHistory

Function createHistory

frontend/src/api/history.ts:14–35  ·  view source on GitHub ↗
(
  topic: string,
  outline: { raw: string; pages: Page[] },
  taskId?: string
)

Source from the content-addressed store, hash-verified

12import type { AppError } from '../utils/errors'
13
14export 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
37export async function getHistoryList(
38 page: number = 1,

Callers 1

ensureRecordFunction · 0.90

Calls 2

getApiErrorPayloadFunction · 0.90
postMethod · 0.80

Tested by

no test coverage detected