Merge branch 'develop' into delete_runs_notification
This commit is contained in:
@@ -24,6 +24,36 @@ export const getStoredRecordings = async (): Promise<string[] | null> => {
|
||||
}
|
||||
};
|
||||
|
||||
export const updateRecording = async (id: string, data: { name?: string; limit?: number }): Promise<boolean> => {
|
||||
try {
|
||||
const response = await axios.put(`${apiUrl}/storage/recordings/${id}`, data);
|
||||
if (response.status === 200) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(`Couldn't update recording with id ${id}`);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(`Error updating recording: ${error.message}`);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export const duplicateRecording = async (id: string, targetUrl: string): Promise<any> => {
|
||||
try {
|
||||
const response = await axios.post(`${apiUrl}/storage/recordings/${id}/duplicate`, {
|
||||
targetUrl,
|
||||
});
|
||||
if (response.status === 201) {
|
||||
return response.data; // Returns the duplicated robot details
|
||||
} else {
|
||||
throw new Error(`Couldn't duplicate recording with id ${id}`);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(`Error duplicating recording: ${error.message}`);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export const getStoredRuns = async (): Promise<string[] | null> => {
|
||||
try {
|
||||
const response = await axios.get(`${apiUrl}/storage/runs`);
|
||||
|
||||
Reference in New Issue
Block a user