client: all requests to server now include language preference

This commit is contained in:
AdrienLSH 2024-03-06 11:08:48 +01:00
parent 2e2f67fe0c
commit 3c0bfa2cd5

View File

@ -96,6 +96,9 @@ class Client
{
let response = await fetch(this._url + uri, {
method: "GET",
headers: {
'Accept-Language': this.lang.currentLang
},
body: JSON.stringify(data),
});
return response;
@ -134,7 +137,8 @@ class Client
headers: {
"Content-Type": "application/json",
"X-CSRFToken": getCookie("csrftoken"),
},
'Accept-Language': this.lang.currentLang,
},
body: JSON.stringify(data),
});
return response;
@ -153,7 +157,8 @@ class Client
headers: {
"X-CSRFToken": getCookie("csrftoken"),
"Content-Type": "application/json",
},
'Accept-Language': this.lang.currentLang,
},
body: JSON.stringify(data),
});
return response;
@ -171,7 +176,8 @@ class Client
method: "PATCH",
headers: {
"X-CSRFToken": getCookie("csrftoken"),
},
'Accept-Language': this.lang.currentLang,
},
body: file,
});
return response;