Skip to content

Commit

Permalink
IBX-9136: [ALW] UI language issue vs content language
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti authored and bogusez committed Nov 29, 2024
1 parent 60ce234 commit 1000ab7
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -204,7 +202,6 @@ export const findLocationsBySearchQuery = (
ViewInput: {
identifier: `udw-locations-by-search-query-${query.FullTextCriterion}`,
public: false,
languageCode,
useAlwaysAvailable,
LocationQuery: {
FacetBuilders: {},
Expand All @@ -223,7 +220,7 @@ export const findLocationsBySearchQuery = (
},
};

addLanguageCodeToCreateViewEndpoint(body);
addLanguageCodeToCreateViewEndpoint(body, languageCode);

const abortController = new AbortController();
const request = new Request(`${instanceUrl}${ENDPOINT_CREATE_VIEW}`, {
Expand Down

0 comments on commit 1000ab7

Please sign in to comment.