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
mr13.0
Hugo Zigha 1 year ago committed by Hugo Zigha
parent a6fd358cd5
commit 51bc01af96

@ -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