feat: use id for scheduling

This commit is contained in:
karishmas6
2024-10-10 03:35:37 +05:30
parent 6d38e3f234
commit c7f7beaefc

View File

@@ -118,15 +118,15 @@ export const notifyAboutAbort = async (id:string): Promise<boolean> => {
} }
} }
export const scheduleStoredRecording = async (fileName: string, settings: ScheduleSettings): Promise<ScheduleRunResponse> => { export const scheduleStoredRecording = async (id: string, settings: ScheduleSettings): Promise<ScheduleRunResponse> => {
try { try {
const response = await axios.put( const response = await axios.put(
`http://localhost:8080/storage/schedule/${fileName}`, `http://localhost:8080/storage/schedule/${id}`,
{...settings}); {...settings});
if (response.status === 200) { if (response.status === 200) {
return response.data; return response.data;
} else { } 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) { } catch(error: any) {
console.log(error); console.log(error);