From ef6fa8d21249c2d50895db7c23062c8a70d9698d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 22 Oct 2024 21:05:52 +0530 Subject: [PATCH] feat: delete schedule --- src/api/storage.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/api/storage.ts b/src/api/storage.ts index 1417f418..ccd54d1d 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -160,4 +160,18 @@ export const getSchedule = async (id: string): Promise console.log(error); return null; } +} + +export const deleteSchedule = async (id: string): Promise => { + 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; + } } \ No newline at end of file