Package booking inbound seat selection issue resolution

This commit is contained in:
Stephanos A
2026-07-05 21:09:30 +03:00
parent cacced8edf
commit e8b7c12412

View File

@@ -198,11 +198,11 @@ export default function SeatsPage() {
seatId: seatIds[i],
}));
const isInbound = isRoundTrip && currentJourneyType === "inbound";
const isInbound = currentJourneyType === "inbound";
// Always use the schedule's own station IDs (set from schedule.origin.id / schedule.destination.id)
// so they are guaranteed to exist in the trip's TripStopTime records.
const scheduleForHold = isInbound ? inboundSchedule : (isRoundTrip ? outboundSchedule : selectedSchedule);
const scheduleForHold = isInbound && inboundSchedule ? inboundSchedule : (outboundSchedule || selectedSchedule);
const originId = (scheduleForHold as any)?.originStationId || searchCriteria?.originStationId;
const destinationId = (scheduleForHold as any)?.destinationStationId || searchCriteria?.destinationStationId;
@@ -215,7 +215,7 @@ export default function SeatsPage() {
});
},
onSuccess: (data: any) => {
const isInbound = isRoundTrip && currentJourneyType === "inbound";
const isInbound = currentJourneyType === "inbound";
if (isInbound) {
// Merge the return hold into the existing outbound hold
const current = useBookingStore.getState().seatHold;