MT#60711 removing lang parameter when we use api v2

Due to some changes on api v2, we cannot pass a parameter that doesn't exist to api.
In csc, we put the lang parameter in each call but it returns an error when using api v2.
So in the case we use api v2 we just removed this parameter.

Change-Id: Ib9e5decc67178d65626a285688e41b88b16e0b03
(cherry picked from commit 51bc01af96)
mr12.5
Hugo Zigha 1 year ago committed by Marco Capetta
parent 8e1b8bb655
commit 44d1346a91

@ -84,16 +84,19 @@ export function initAPI ({ baseURL }) {
if (config.method === 'POST' && (config.data === undefined || config.data === null)) {
config.data = {}
}
if (config.params) {
config.params = {
...config.params,
lang: getCurrentLangAsV1Format()
}
} else {
config.params = {
lang: getCurrentLangAsV1Format()
if (!config?.url.includes('v2')) {
if (config.params) {
config.params = {
...config.params,
lang: getCurrentLangAsV1Format()
}
} else {
config.params = {
lang: getCurrentLangAsV1Format()
}
}
}
return config
}
})

Loading…
Cancel
Save