From 924d687e20fb20cd321f242bfa6c8a0666fc52b0 Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Thu, 20 Nov 2025 15:54:39 +0530 Subject: [PATCH] feat: add create markdown api --- src/api/storage.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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}>;