New route to delete the next alarm

This commit is contained in:
nemunaire 2022-12-08 16:43:56 +01:00
commit fa13484718
4 changed files with 78 additions and 1 deletions

View file

@ -33,6 +33,18 @@ export async function alarmNextTrack() {
}
}
export async function deleteNextAlarm() {
const res = await fetch('api/alarms/next', {
method: 'DELETE',
headers: {'Accept': 'application/json'},
});
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
export async function alarmStop() {
const res = await fetch('api/alarm', {
method: 'DELETE',