fix: add xhr header to eliminate redirects on setlang (#45)

This commit is contained in:
Adam Butterworth
2019-05-15 14:26:31 -06:00
committed by GitHub
parent a93dc4e3b1
commit 91d7b98e08

View File

@@ -37,10 +37,9 @@ async function patchPreferences(username, params) {
async function postSetLang(code) {
const formData = new FormData();
formData.append('language', getAssumedServerLanguageCode(code));
formData.append('next', `${config.BASE_URL}/account-settings`);
await apiClient.post(`${config.LMS_BASE_URL}/i18n/setlang/`, formData, {
headers: { 'Content-Type': 'multipart/form-data' },
headers: { 'X-Requested-With': 'XMLHttpRequest' },
});
}