feat: get schedule of a robot

This commit is contained in:
karishmas6
2024-10-22 20:43:49 +05:30
parent 2a7df010f9
commit ec5b4a8372

View File

@@ -147,3 +147,18 @@ export const scheduleStoredRecording = async (id: string, settings: ScheduleSett
return {message: '', runId: ''};
}
}
export const getSchedule = async (id: string): Promise<ScheduleSettings | null> => {
try {
const response = await axios.get(`http://localhost:8080/storage/schedule/${id}`);
if (response.status === 200) {
return response.data;
} else {
throw new Error(`Couldn't retrieve schedule for recording ${id}`);
}
} catch(error: any) {
console.log(error);
return null;
}
}