@json-layout/core 1.15.0 → 1.15.1
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/src/state/index.js +2 -2
package/package.json
CHANGED
package/src/state/index.js
CHANGED
|
@@ -583,13 +583,13 @@ export class StatefulLayout {
|
|
|
583
583
|
let qSearchParam = node.layout.getItems.qSearchParam
|
|
584
584
|
if (!qSearchParam) {
|
|
585
585
|
for (const searchParam of url.searchParams.entries()) {
|
|
586
|
-
if (searchParam[1]
|
|
586
|
+
if (searchParam[1].includes('{q}')) qSearchParam = searchParam[0]
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
if (qSearchParam) {
|
|
590
590
|
logGetItems(node.fullKey, 'apply search params', qSearchParam)
|
|
591
591
|
appliedQ = true
|
|
592
|
-
if (q) url.searchParams.set(qSearchParam, q)
|
|
592
|
+
if (q) url.searchParams.set(qSearchParam, url.searchParams.get(qSearchParam)?.replace('{q}', q) ?? q)
|
|
593
593
|
else url.searchParams.delete(qSearchParam)
|
|
594
594
|
}
|
|
595
595
|
let fetchOptions = typeof node.options.fetchOptions === 'function' ? node.options.fetchOptions(url) : node.options.fetchOptions
|