File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/evently.client/src/routes/gatherings/$gatheringId Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments