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 {
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;