feat: delete schedule
This commit is contained in:
@@ -160,4 +160,18 @@ export const getSchedule = async (id: string): Promise<ScheduleSettings | null>
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
return null;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user