New route to delete the next alarm
This commit is contained in:
parent
4e0450faca
commit
fa13484718
4 changed files with 78 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue