Skip to content

Commit 0bbcdde

Browse files
authored
fix: registration (#45)
* fix: registration * fix: registration
1 parent 7932aa2 commit 0bbcdde

File tree

1 file changed

+11
-6
lines changed
  • src/evently.client/src/routes/gatherings/$gatheringId

1 file changed

+11
-6
lines changed

src/evently.client/src/routes/gatherings/$gatheringId/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ export const Route = createFileRoute("/gatherings/$gatheringId/")({
2020
const accountId: string | undefined = context.account?.id;
2121
const gatheringId: number = parseInt(params.gatheringId);
2222
const gathering: Gathering | null = await getGathering(gatheringId);
23-
const { data: bookings } = await getBookings({
24-
attendeeId: accountId ?? "",
25-
gatheringId,
26-
isCancelled: false
27-
});
23+
let booking: Booking | null = null;
24+
if (accountId != null && accountId.trim().length > 0) {
25+
const { data: bookings } = await getBookings({
26+
attendeeId: accountId,
27+
gatheringId,
28+
isCancelled: false
29+
});
30+
booking = bookings.length > 0 ? bookings[0] : null;
31+
}
32+
2833
return {
2934
gathering,
30-
booking: bookings.length > 0 ? bookings[0] : null
35+
booking
3136
};
3237
},
3338
component: GatheringPage,

0 commit comments

Comments
 (0)