tripstorekrabi-shared 1.26.2 → 1.26.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/product.js +8 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.26.2",
3
+ "version": "1.26.3",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/product.js CHANGED
@@ -68,7 +68,7 @@ export function buildIndex(id, product) {
68
68
  const isTransfer = Boolean(product.from && product.to);
69
69
 
70
70
  if (isTransfer) {
71
- // For transfers, always derive destinations directly from `from` and `to`
71
+ // For transfers, derive destinations directly from `from` and `to`
72
72
  const transferDestinations = Array.from(
73
73
  new Set([product.from, product.to].map((d) => String(d || '').trim()).filter(Boolean))
74
74
  );
@@ -76,12 +76,13 @@ export function buildIndex(id, product) {
76
76
  document.destinations = transferDestinations;
77
77
  }
78
78
  } else {
79
- // For activities, clean and deduplicate `destinations` (or fallback to `destination`)
80
- const rawDestinations = Array.isArray(product.destinations)
81
- ? product.destinations
82
- : product.destination
83
- ? [product.destination]
84
- : [];
79
+ // 1. Assign new `places` array directly
80
+ if (Array.isArray(product.places) && product.places.length > 0) {
81
+ document.places = product.places;
82
+ }
83
+
84
+ // 2. Keep legacy `destinations` array populated during transition
85
+ const rawDestinations = Array.isArray(product.destinations) ? product.destinations : [];
85
86
 
86
87
  const cleanedDestinations = Array.from(
87
88
  new Set(rawDestinations.map((d) => String(d || '').trim()).filter(Boolean))