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.
- package/package.json +1 -1
- package/product.js +8 -7
package/package.json
CHANGED
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,
|
|
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
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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))
|