diff --git a/src/api/storage.ts b/src/api/storage.ts index b5dc32de..ca4d975c 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -28,6 +28,27 @@ export const getStoredRecordings = async (): Promise => { } }; +export const createMarkdownRobot = async (url: string, name?: string): Promise => { + try { + const response = await axios.post(`${apiUrl}/storage/recordings/markdown`, { + url, + name, + }, { + headers: { 'Content-Type': 'application/json' }, + withCredentials: true + }); + + if (response.status === 201) { + return response.data; + } else { + throw new Error('Failed to create markdown robot'); + } + } catch (error: any) { + console.error('Error creating markdown robot:', error); + return null; + } +}; + export const updateRecording = async (id: string, data: { name?: string; limits?: Array<{pairIndex: number, actionIndex: number, argIndex: number, limit: number}>;