fix(dashboard): bind Upcoming sidebar to reactive useFetch data

ColumnsLayout mounts inside <ClientOnly> on /member/dashboard, so the
SSR fetch returned the empty default and the snapshot assignment to
upcomingEvents never re-ran after the client-side fetch resolved.

Skip the SSR phase explicitly (server: false) and expose data to the
template via a computed so post-fetch updates propagate to
EventsMiniSidebar.
This commit is contained in:
Jennie Robinson Faber 2026-05-19 00:10:27 +01:00
parent 94b242100c
commit 050d117abf

View file

@ -29,13 +29,14 @@ const props = defineProps({
limit: { type: Number, default: 3 },
})
const upcomingEvents = ref([])
let upcomingEvents = ref([])
if (props.cols === 'events-sidebar') {
const { data } = await useFetch('/api/events', {
query: { upcoming: true, limit: props.limit },
default: () => [],
server: false,
})
upcomingEvents.value = data.value || []
upcomingEvents = computed(() => data.value || [])
}
</script>