| @@ -180,13 +180,15 @@ | ||
| 180 | 180 | document.addEventListener("mousedown", handleClickOutside); |
| 181 | 181 | return () => document.removeEventListener("mousedown", handleClickOutside); |
| 182 | 182 | }, []); |
| 183 | 183 | |
| 184 | - // Fetch booking form configuration | |
| 184 | + // Fetch booking form configuration, resolved for the selected trip so a | |
| 185 | + // per-trip form version (Pro conditions) shows the right fields here too. | |
| 186 | + const selectedTripId = formData.trip_id ? Number(formData.trip_id) : null; | |
| 185 | 187 | const { data: formConfig } = useQuery<BookingFormConfig>({ |
| 186 | - queryKey: ["booking-form-config"], | |
| 188 | + queryKey: ["booking-form-config", selectedTripId], | |
| 187 | 189 | queryFn: async () => { |
| 188 | - const response = await apiService.getSettings(); | |
| 190 | + const response = await apiService.getBookingFormConfig(selectedTripId); | |
| 189 | 191 | return ( |
| 190 | 192 | response?.data?.booking_form_config || |
| 191 | 193 | response?.booking_form_config || |
| 192 | 194 | null |
| @@ -1633,9 +1635,12 @@ | ||
| 1633 | 1635 | placeholder={ |
| 1634 | 1636 | field.placeholder || |
| 1635 | 1637 | __("Select Country", "yatra") |
| 1636 | 1638 | } |
| 1637 | - searchPlaceholder={__("Search country", "yatra")} | |
| 1639 | + searchPlaceholder={__( | |
| 1640 | + "Search country", | |
| 1641 | + "yatra", | |
| 1642 | + )} | |
| 1638 | 1643 | /> |
| 1639 | 1644 | ) : field.type === "textarea" ? ( |
| 1640 | 1645 | <textarea |
| 1641 | 1646 | id={`emergency-${field.id}`} |