mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-01 16:55:21 +03:00
Update web/src/routes/Event.jsx
Co-authored-by: Paul Armstrong <paularmstrong@users.noreply.github.com>
This commit is contained in:
parent
35071a4c5f
commit
3b44a0bfe1
@ -32,8 +32,7 @@ export default function Event({ eventId }) {
|
|||||||
let success;
|
let success;
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${apiHost}/api/events/${eventId}`, { method: 'DELETE' });
|
const response = await fetch(`${apiHost}/api/events/${eventId}`, { method: 'DELETE' });
|
||||||
const deleteEvent = await getJSON(response)
|
const { success = false, message } = await getJSON(response)
|
||||||
success = deleteEvent.success;
|
|
||||||
setDeleteStatus(success ? FetchStatus.LOADED : FetchStatus.ERROR);
|
setDeleteStatus(success ? FetchStatus.LOADED : FetchStatus.ERROR);
|
||||||
setDeleteMessage(deleteEvent.message);
|
setDeleteMessage(deleteEvent.message);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user