diff --git a/src/api/storage.ts b/src/api/storage.ts index 47946717..054aeee8 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -118,15 +118,15 @@ export const notifyAboutAbort = async (id:string): Promise => { } } -export const scheduleStoredRecording = async (fileName: string, settings: ScheduleSettings): Promise => { +export const scheduleStoredRecording = async (id: string, settings: ScheduleSettings): Promise => { try { const response = await axios.put( - `http://localhost:8080/storage/schedule/${fileName}`, + `http://localhost:8080/storage/schedule/${id}`, {...settings}); if (response.status === 200) { return response.data; } else { - throw new Error(`Couldn't schedule recording ${fileName}. Please try again later.`); + throw new Error(`Couldn't schedule recording ${id}. Please try again later.`); } } catch(error: any) { console.log(error); diff --git a/src/components/molecules/RecordingsTable.tsx b/src/components/molecules/RecordingsTable.tsx index 77cf7e8e..3da2a452 100644 --- a/src/components/molecules/RecordingsTable.tsx +++ b/src/components/molecules/RecordingsTable.tsx @@ -72,9 +72,9 @@ interface Data { interface RecordingsTableProps { handleEditRecording: (id: string, fileName: string) => void; - handleRunRecording: (id: string,fileName: string, params: string[]) => void; - handleScheduleRecording: (id: string,fileName: string, params: string[]) => void; - handleIntegrateRecording: (id: string,fileName: string, params: string[]) => void; + handleRunRecording: (id: string, fileName: string, params: string[]) => void; + handleScheduleRecording: (id: string, fileName: string, params: string[]) => void; + handleIntegrateRecording: (id: string, fileName: string, params: string[]) => void; } export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handleScheduleRecording, handleIntegrateRecording }: RecordingsTableProps) => { diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index f2f3e664..adb0a1f3 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -108,7 +108,7 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => { }, [runningRecordingName, sockets, ids, readyForRunHandler, debugMessageHandler]) const handleScheduleRecording = (settings: ScheduleSettings) => { - scheduleStoredRecording(runningRecordingName, settings) + scheduleStoredRecording(runningRecordingId, settings) .then(({ message, runId }: ScheduleRunResponse) => { if (message === 'success') { notify('success', `Recording ${runningRecordingName} scheduled successfully`); @@ -118,6 +118,7 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => { }); } + // todo: use runningRecordingId here (first change in backend) const handleIntegrateRecording = (settings: IntegrationSettings) => { handleUploadCredentials(runningRecordingName, settings.credentials, settings.spreadsheetId, settings.range) .then((response) => {