Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/evently.client/src/routes/gatherings/$gatheringId/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ export const Route = createFileRoute("/gatherings/$gatheringId/")({
const accountId: string | undefined = context.account?.id;
const gatheringId: number = parseInt(params.gatheringId);
const gathering: Gathering | null = await getGathering(gatheringId);
const { data: bookings } = await getBookings({
attendeeId: accountId ?? "",
gatheringId,
isCancelled: false
});
let booking: Booking | null = null;
if (accountId != null && accountId.trim().length > 0) {
const { data: bookings } = await getBookings({
attendeeId: accountId ?? "-1",
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using '-1' as a fallback attendeeId could cause issues if the API doesn't handle this value properly. Consider using a more explicit fallback like null or throwing an error, since the null check above should prevent this case from occurring.

Suggested change
attendeeId: accountId ?? "-1",
attendeeId: accountId,

Copilot uses AI. Check for mistakes.
gatheringId,
isCancelled: false
});
booking = bookings.length > 0 ? bookings[0] : null;
}

return {
gathering,
booking: bookings.length > 0 ? bookings[0] : null
booking
};
},
component: GatheringPage,
Expand Down