@autobusal/routes-order 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this package are documented here. This project follows
4
4
  [Keep a Changelog](https://keepachangelog.com/) and [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [1.6.2] - 2026-07-30
7
+
8
+ ### Fixed
9
+
10
+ - **The full 9-segment `/bus-lines/:from/:to/:departure/:_return/:type/:adults/:children/:babies`
11
+ URL only auto-searched if a `?type=submit` query param was also present**
12
+ (`Step1/Step1.tsx`) - set only when the in-app search form navigated here
13
+ itself. Every OTHER way of reaching this URL - obtapi's
14
+ `Route::linkPurchase()` (which generates exactly this path with no query
15
+ param), a shared link, a search engine crawling it - rendered nothing but
16
+ the empty search form despite the URL already carrying a complete search
17
+ spec. Now also auto-searches whenever `:departure` is present in the path,
18
+ which only the full 9-segment route ever populates.
19
+
6
20
  ## [1.6.1] - 2026-07-27
7
21
 
8
22
  ### Added
package/Step1/Step1.tsx CHANGED
@@ -25,7 +25,17 @@ const Step1 = ({ value, redirected, t, onSave }: Props): JSX.Element => {
25
25
 
26
26
  const prepared = prepare(value, params, searchParams, data.preferences.defaultLocations);
27
27
 
28
- const isSubmitted = searchParams.get('type') === 'submit';
28
+ // Two ways this page ends up with a complete search spec:
29
+ // 1. `?type=submit` - set by the in-app search form (home/Main/Main.tsx)
30
+ // when it navigates here itself.
31
+ // 2. `:departure` present in the URL path - the full 9-segment route
32
+ // (/bus-lines/:from/:to/:departure/:_return/:type/:adults/:children/:babies)
33
+ // already carries a complete search spec with no query param needed.
34
+ // This is how obtapi's Route::linkPurchase() generates links, and how
35
+ // anyone (a search engine, a shared link) reaches this URL directly -
36
+ // previously only case 1 triggered a search, so every one of those
37
+ // deep links rendered nothing but the empty search form.
38
+ const isSubmitted = searchParams.get('type') === 'submit' || params.departure !== undefined;
29
39
 
30
40
  useEffect(() => {
31
41
  if (isSubmitted && !redirected) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"