TT#134104 Issue - password change error shown Russian message ignoring choosen language

NOTE: please AR carefully as the change affects every CSC request

Additions:
After testing the approach of rewriting the url property of the request object, problems appeared. The library vue-resource considers the url property actually as url path and not as the entire url. This is clearly a misleading naming in vue-resource. But for query params it offers the params object.

Change-Id: I27ca475df9ae8cde487907a0e341984e9c384241
pull/9/head
Carlo Venusino 4 years ago committed by Hans-Peter Herzog
parent c7e101c59a
commit b7909020f6

@ -18,7 +18,6 @@ import {
import { import {
assignNumbers assignNumbers
} from './user' } from './user'
import { getCurrentLangAsV1Format } from 'src/i18n'
export function getPreferences (id) { export function getPreferences (id) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -31,11 +30,7 @@ export function getPreferences (id) {
} }
export async function getPreferencesDefs (id) { export async function getPreferencesDefs (id) {
const result = await Vue.http.get('api/subscriberpreferencedefs/', { const result = await Vue.http.get('api/subscriberpreferencedefs/')
params: {
lang: getCurrentLangAsV1Format()
}
})
return getJsonBody(result.body) return getJsonBody(result.body)
} }

@ -4,6 +4,7 @@ import {
getJwt, getJwt,
hasJwt hasJwt
} from 'src/auth' } from 'src/auth'
import { getCurrentLangAsV1Format } from 'src/i18n'
export default ({ Vue, app }) => { export default ({ Vue, app }) => {
Vue.use(VueResource) Vue.use(VueResource)
@ -15,6 +16,10 @@ export default ({ Vue, app }) => {
if (request.method === 'POST' && (request.body === undefined || request.body === null)) { if (request.method === 'POST' && (request.body === undefined || request.body === null)) {
request.body = {} request.body = {}
} }
if (!request.params) {
request.params = {}
}
request.params.lang = getCurrentLangAsV1Format()
next() next()
}) })
} }

Loading…
Cancel
Save