20-calendar-system #37
@@ -26,13 +26,13 @@ const activeEvent = ref<CalendarEvent | null>(null);
|
||||
// });
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
async (id) => {
|
||||
if (!id) return;
|
||||
activeEvent.value = await getCalendarEvent(Number(id));
|
||||
loaded.value = true;
|
||||
},
|
||||
{ immediate: true }
|
||||
() => route.params.id,
|
||||
async (id) => {
|
||||
if (!id) return;
|
||||
activeEvent.value = await getCalendarEvent(Number(id));
|
||||
loaded.value = true;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -71,7 +71,7 @@ const myAttendance = computed<CalendarSignup | null>(() => {
|
||||
});
|
||||
|
||||
async function setAttendance(state: CalendarAttendance) {
|
||||
setCalendarEventAttendance(activeEvent.value.id, state);
|
||||
await setCalendarEventAttendance(activeEvent.value.id, state);
|
||||
//refresh event data
|
||||
activeEvent.value = await getCalendarEvent(activeEvent.value.id);
|
||||
}
|
||||
@@ -98,10 +98,10 @@ async function setAttendance(state: CalendarAttendance) {
|
||||
:class="myAttendance?.status === CalendarAttendance.Attending ? 'border-2 border-primary text-primary' : ''"
|
||||
@click="setAttendance(CalendarAttendance.Attending)">Going</Button>
|
||||
<Button variant="outline"
|
||||
:class="myAttendance?.status === CalendarAttendance.Maybe ? 'border-2 border-primary' : ''"
|
||||
:class="myAttendance?.status === CalendarAttendance.Maybe ? 'border-2 !border-l-2 border-primary text-primary' : ''"
|
||||
@click="setAttendance(CalendarAttendance.Maybe)">Maybe</Button>
|
||||
<Button variant="outline"
|
||||
:class="myAttendance?.status === CalendarAttendance.NotAttending ? 'border-2 border-primary' : ''"
|
||||
:class="myAttendance?.status === CalendarAttendance.NotAttending ? 'border-2 !border-l-2 border-primary text-primary' : ''"
|
||||
@click="setAttendance(CalendarAttendance.NotAttending)">Declined</Button>
|
||||
</ButtonGroup>
|
||||
</section>
|
||||
@@ -121,7 +121,7 @@ async function setAttendance(state: CalendarAttendance) {
|
||||
<span class="inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs">
|
||||
<User class="size-3.5 opacity-80" />
|
||||
<span class="font-medium">Created by: {{ activeEvent.creator_name || "Unknown User"
|
||||
}}</span>
|
||||
}}</span>
|
||||
</span>
|
||||
</section>
|
||||
<!-- Description -->
|
||||
|
||||
Reference in New Issue
Block a user