From ecc6a55aba7bb35fc778e7a53848396b88214151 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sat, 23 Aug 2025 22:29:28 +0100
Subject: Add multiple conferences feature

---
 web/components/EventListing.vue | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'web/components/EventListing.vue')

diff --git a/web/components/EventListing.vue b/web/components/EventListing.vue
index 5c04189..0cc546c 100644
--- a/web/components/EventListing.vue
+++ b/web/components/EventListing.vue
@@ -10,6 +10,7 @@ const { event, showRelativeTime } = defineProps<{
 }>();
 
 const selectedEventStore = useSelectedEventStore();
+const conferenceStore = useConferenceStore();
 const favouritesStore = useFavouritesStore();
 const errorStore = useErrorStore();
 const config = useRuntimeConfig();
@@ -43,9 +44,10 @@ const addFavourite = async () => {
   addingToFavourite.value = true;
   
   try {
-    const res = await $fetch(config.public.baseURL + '/favourites', {
+    const res = await $api(config.public.baseURL + '/favourites', {
       method: 'POST',
       body: JSON.stringify({
+        conferenceId: conferenceStore.id,
         eventGuid: event.guid,
         eventId: event.id,
       }),
@@ -70,7 +72,7 @@ const removeFavourite = async () => {
   addingToFavourite.value = true;
 
   try {
-    await $fetch(config.public.baseURL + '/favourites', {
+    await $api(config.public.baseURL + '/favourites', {
       method: 'DELETE',
       body: JSON.stringify({
         eventGuid: event.guid,
@@ -102,9 +104,9 @@ const removeFavourite = async () => {
       </span>
       <span class="event-title">{{ event.title }}</span>
       <span class="event-speaker">{{ event.persons.map(p => p.name).join(", ") }}</span>
-      <span class="event-track">{{ event.track.name }}</span>
+      <span class="event-track">{{ event.track?.name }}</span>
     </div>
-    <template v-if="!addingToFavourite" class="event-button">
+    <template v-if="!addingToFavourite && favouritesStore.status !== 'pending'" class="event-button">
       <StarIcon v-if="favouritesStore.isFavourite(event)" color="var(--color-favourite)" fill="var(--color-favourite)" class="event-button" @click="removeFavourite" />
       <StarIcon v-else color="var(--color-text-muted)" class="event-button" @click="addFavourite" />
     </template>
-- 
cgit v1.2.3-70-g09d2

