From 2eb7c4d8516ad19138d0dbc7aeec98f0306454ee Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 12 Jun 2025 11:17:59 +0530 Subject: [PATCH] feat: modify notify abort route --- src/api/storage.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(