From a36430faed1519863e2627e989351a0bafd87df7 Mon Sep 17 00:00:00 2001 From: AleX83Xpert Date: Mon, 8 Apr 2024 09:15:26 +0500 Subject: [PATCH 1/2] fix(address-service): DOMA-8791 pass data from query to body for single search url --- .../domains/common/utils/services/search/SearchKeystoneApp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js b/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js index 60eece4b3d2..88f539faf21 100644 --- a/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js +++ b/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js @@ -83,6 +83,9 @@ class SearchKeystoneApp { const strategy = new StrategyEachItemToPlugins(keystone, this.plugins) set(req, ['body', 'items'], [s]) + for (const p of ['context', 'helpers', 'extractUnit']) { + set(req, ['body', p], get(req, ['query', p])) + } try { const strategyResult = await strategy.search(req) From 3ad19cb838646e3e256d4ccf3a51b93d096e16c0 Mon Sep 17 00:00:00 2001 From: AleX83Xpert Date: Mon, 8 Apr 2024 15:25:58 +0500 Subject: [PATCH 2/2] fix(address-service): DOMA-8791 pass helpers as json --- .../common/utils/services/search/SearchKeystoneApp.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js b/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js index 88f539faf21..2e91104fdd3 100644 --- a/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js +++ b/apps/address-service/domains/common/utils/services/search/SearchKeystoneApp.js @@ -83,9 +83,15 @@ class SearchKeystoneApp { const strategy = new StrategyEachItemToPlugins(keystone, this.plugins) set(req, ['body', 'items'], [s]) - for (const p of ['context', 'helpers', 'extractUnit']) { + for (const p of ['context', 'extractUnit']) { set(req, ['body', p], get(req, ['query', p])) } + try { + set(req, ['body', 'helpers'], JSON.parse(get(req, ['query', 'helpers']))) + } catch (e) { + set(req, ['body', 'helpers'], undefined) + } + try { const strategyResult = await strategy.search(req)