feat: modify scrape api to support html

This commit is contained in:
Rohit Rajan
2025-11-20 18:52:28 +05:30
parent a9a8e20e61
commit c89b2afed6

View File

@@ -28,15 +28,24 @@ export const getStoredRecordings = async (): Promise<string[] | null> => {
} }
}; };
export const createMarkdownRobot = async (url: string, name?: string): Promise<any> => { export const createScrapeRobot = async (
url: string,
name?: string,
formats: string[] = ['markdown']
): Promise<any> => {
try { try {
const response = await axios.post(`${apiUrl}/storage/recordings/markdown`, { const response = await axios.post(
url, `${apiUrl}/storage/recordings/scrape`,
name, {
}, { url,
headers: { 'Content-Type': 'application/json' }, name,
withCredentials: true formats,
}); },
{
headers: { 'Content-Type': 'application/json' },
withCredentials: true,
}
);
if (response.status === 201) { if (response.status === 201) {
return response.data; return response.data;