Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Dec 10, 2024
2 parents 3b9617e + 81009e5 commit 62985f0
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 62985f0

Please sign in to comment.