client: all requests to server now include language preference
This commit is contained in:
parent
6d9decf913
commit
daddf5bb25
@ -96,6 +96,9 @@ class Client
|
|||||||
{
|
{
|
||||||
let response = await fetch(this._url + uri, {
|
let response = await fetch(this._url + uri, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
'Accept-Language': this.lang.currentLang
|
||||||
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
@ -134,7 +137,8 @@ class Client
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-CSRFToken": getCookie("csrftoken"),
|
"X-CSRFToken": getCookie("csrftoken"),
|
||||||
},
|
'Accept-Language': this.lang.currentLang,
|
||||||
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
@ -153,7 +157,8 @@ class Client
|
|||||||
headers: {
|
headers: {
|
||||||
"X-CSRFToken": getCookie("csrftoken"),
|
"X-CSRFToken": getCookie("csrftoken"),
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
'Accept-Language': this.lang.currentLang,
|
||||||
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
@ -171,7 +176,8 @@ class Client
|
|||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
headers: {
|
headers: {
|
||||||
"X-CSRFToken": getCookie("csrftoken"),
|
"X-CSRFToken": getCookie("csrftoken"),
|
||||||
},
|
'Accept-Language': this.lang.currentLang,
|
||||||
|
},
|
||||||
body: file,
|
body: file,
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
|
Loading…
Reference in New Issue
Block a user