diff --git a/src/api/storage.ts b/src/api/storage.ts index 295f340c..9e47f533 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -184,20 +184,24 @@ export const interpretStoredRecording = async (id: string): Promise => } } -export const notifyAboutAbort = async (id: string): Promise => { +export const notifyAboutAbort = async (id: string): Promise<{ success: boolean; isQueued?: boolean }> => { try { - const response = await axios.post(`${apiUrl}/storage/runs/abort/${id}`); + const response = await axios.post(`${apiUrl}/robot/runs/abort/${id}`, { withCredentials: true }); if (response.status === 200) { - return response.data; + return { + success: response.data.success, + isQueued: response.data.isQueued + }; } else { throw new Error(`Couldn't abort a running recording with id ${id}`); } } catch (error: any) { console.log(error); - return false; + return { success: false }; } } + export const scheduleStoredRecording = async (id: string, settings: ScheduleSettings): Promise => { try { const response = await axios.put(