|
|
|
|
@ -115,9 +115,14 @@ export default function Events() {
|
|
|
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
|
|
if (events === null) { |
|
|
|
|
const res = await fetch(endpoint, fetch_options) |
|
|
|
|
const result = await res.json() |
|
|
|
|
setEvents(events) |
|
|
|
|
let result = [] |
|
|
|
|
try { |
|
|
|
|
const res = await fetch(endpoint, fetch_options) |
|
|
|
|
result = await res.json() |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error(error) |
|
|
|
|
} |
|
|
|
|
setEvents(result) |
|
|
|
|
} |
|
|
|
|
}, [events]) |
|
|
|
|
|
|
|
|
|
|