Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-9136: [ALW] UI language issue vs content language #1392

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading