feat: add create markdown api

This commit is contained in:
Rohit Rajan
2025-11-20 15:54:39 +05:30
parent 8346c9637a
commit 924d687e20

View File

@@ -28,6 +28,27 @@ export const getStoredRecordings = async (): Promise<string[] | null> => {
}
};
export const createMarkdownRobot = async (url: string, name?: string): Promise<any> => {
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}>;