From c89b2afed624df52c1f76cd0129f4265528cef16 Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Thu, 20 Nov 2025 18:52:28 +0530 Subject: [PATCH] feat: modify scrape api to support html --- src/api/storage.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/api/storage.ts b/src/api/storage.ts index ca4d975c..d2b28d5e 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -28,15 +28,24 @@ export const getStoredRecordings = async (): Promise => { } }; -export const createMarkdownRobot = async (url: string, name?: string): Promise => { +export const createScrapeRobot = async ( + url: string, + name?: string, + formats: string[] = ['markdown'] +): Promise => { try { - const response = await axios.post(`${apiUrl}/storage/recordings/markdown`, { - url, - name, - }, { - headers: { 'Content-Type': 'application/json' }, - withCredentials: true - }); + const response = await axios.post( + `${apiUrl}/storage/recordings/scrape`, + { + url, + name, + formats, + }, + { + headers: { 'Content-Type': 'application/json' }, + withCredentials: true, + } + ); if (response.status === 201) { return response.data;