From 81009e5305ee8934a2a3ff8468f260ffb95cf7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ostafin?= Date: Tue, 10 Dec 2024 08:15:11 +0100 Subject: [PATCH] IBX-9136: [ALW] UI language issue vs content language (#1392) --- .../services/universal.discovery.service.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/services/universal.discovery.service.js b/src/bundle/ui-dev/src/modules/universal-discovery/services/universal.discovery.service.js index a5bc8011e9..3bb4926bc2 100644 --- a/src/bundle/ui-dev/src/modules/universal-discovery/services/universal.discovery.service.js +++ b/src/bundle/ui-dev/src/modules/universal-discovery/services/universal.discovery.service.js @@ -17,12 +17,10 @@ const ENDPOINT_LOCATION_LIST = '/api/ibexa/v2/module/universal-discovery/locatio export const QUERY_LIMIT = 50; export const AGGREGATIONS_LIMIT = 4; -const addLanguageCodeToCreateViewEndpoint = (body) => { +const addLanguageCodeToCreateViewEndpoint = (body, languageCode) => { const adminUiConfig = getAdminUiConfig(); - if (adminUiConfig.languages.priority[0]) { - body.ViewInput.languageCode = adminUiConfig.languages.priority[0]; - } + body.ViewInput.languageCode = languageCode ?? adminUiConfig.languages.priority[0]; }; const showErrorNotificationAbortWrapper = (error) => { @@ -204,7 +202,6 @@ export const findLocationsBySearchQuery = ( ViewInput: { identifier: `udw-locations-by-search-query-${query.FullTextCriterion}`, public: false, - languageCode, useAlwaysAvailable, LocationQuery: { FacetBuilders: {}, @@ -223,7 +220,7 @@ export const findLocationsBySearchQuery = ( }, }; - addLanguageCodeToCreateViewEndpoint(body); + addLanguageCodeToCreateViewEndpoint(body, languageCode); const abortController = new AbortController(); const request = new Request(`${instanceUrl}${ENDPOINT_CREATE_VIEW}`, {