remove alert from delete function
This commit is contained in:
@@ -57,17 +57,11 @@ export async function updateEntry(entry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteEntry(entry) {
|
export async function deleteEntry(entry) {
|
||||||
const res = await fetch(`/api/entry/delete`, {
|
await fetch(`/api/entry/delete`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ id: entry.id })
|
body: JSON.stringify({ id: entry.id })
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
entry = null;
|
|
||||||
} else {
|
|
||||||
alert('Failed to delete entry');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user