feat: delete schedule

This commit is contained in:
karishmas6
2024-10-22 21:05:52 +05:30
parent ed9fa486d7
commit ef6fa8d212

View File

@@ -160,4 +160,18 @@ export const getSchedule = async (id: string): Promise<ScheduleSettings | null>
console.log(error);
return null;
}
}
export const deleteSchedule = async (id: string): Promise<boolean> => {
try {
const response = await axios.delete(`http://localhost:8080/storage/schedule/${id}`);
if (response.status === 200) {
return response.data;
} else {
throw new Error(`Couldn't delete schedule for recording ${id}`);
}
} catch (error: any) {
console.log(error);
return false;
}
}