diff --git a/src/components/channelMapper/channelMapper.js b/src/components/channelMapper/channelMapper.js index 89d085c185..a5e5cc3537 100644 --- a/src/components/channelMapper/channelMapper.js +++ b/src/components/channelMapper/channelMapper.js @@ -19,11 +19,11 @@ export default class channelMapper { connectionManager.getApiClient(options.serverId).ajax({ type: 'POST', url: ApiClient.getUrl('LiveTv/ChannelMappings'), - data: { + data: JSON.stringify({ providerId: providerId, tunerChannelId: channelId, providerChannelId: providerChannelId - }, + }), dataType: 'json' }).then(mapping => { const listItem = dom.parentWithClass(button, 'listItem'); diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index 41744bdcbb..5c44db3b15 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -166,10 +166,10 @@ import 'emby-button'; return apiClient.ajax({ type: 'POST', url: apiClient.getUrl('Environment/ValidatePath'), - data: { + data: JSON.stringify({ ValidateWriteable: validateWriteable, Path: path - } + }) }).catch(response => { if (response) { if (response.status === 404) { diff --git a/src/controllers/dashboard/encodingsettings.js b/src/controllers/dashboard/encodingsettings.js index 3a0ad24430..320a679b37 100644 --- a/src/controllers/dashboard/encodingsettings.js +++ b/src/controllers/dashboard/encodingsettings.js @@ -45,10 +45,10 @@ import libraryMenu from 'libraryMenu'; return ApiClient.ajax({ url: ApiClient.getUrl('System/MediaEncoder/Path'), type: 'POST', - data: { + data: JSON.stringify({ Path: form.querySelector('.txtEncoderPath').value, PathType: 'Custom' - } + }) }).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure); }); } diff --git a/src/controllers/session/forgotPassword/index.js b/src/controllers/session/forgotPassword/index.js index 368642db35..45e05409da 100644 --- a/src/controllers/session/forgotPassword/index.js +++ b/src/controllers/session/forgotPassword/index.js @@ -41,9 +41,9 @@ import globalize from 'globalize'; type: 'POST', url: ApiClient.getUrl('Users/ForgotPassword'), dataType: 'json', - data: { + data: JSON.stringify({ EnteredUsername: view.querySelector('#txtName').value - } + }) }).then(processForgotPasswordResult); e.preventDefault(); return false; diff --git a/src/controllers/session/resetPassword/index.js b/src/controllers/session/resetPassword/index.js index a88e131eea..3cb8d4a9e2 100644 --- a/src/controllers/session/resetPassword/index.js +++ b/src/controllers/session/resetPassword/index.js @@ -29,9 +29,9 @@ import globalize from 'globalize'; type: 'POST', url: ApiClient.getUrl('Users/ForgotPassword/Pin'), dataType: 'json', - data: { + data: JSON.stringify({ Pin: view.querySelector('#txtPin').value - } + }) }).then(processForgotPasswordResult); e.preventDefault(); return false; diff --git a/src/controllers/wizard/remote/index.js b/src/controllers/wizard/remote/index.js index 3c482607de..74c795658d 100644 --- a/src/controllers/wizard/remote/index.js +++ b/src/controllers/wizard/remote/index.js @@ -11,7 +11,7 @@ function save(page) { config.EnableAutomaticPortMapping = page.querySelector('#chkEnableUpnp').checked; apiClient.ajax({ type: 'POST', - data: config, + data: JSON.stringify(config), url: apiClient.getUrl('Startup/RemoteAccess') }).then(function () { loading.hide(); diff --git a/src/controllers/wizard/settings/index.js b/src/controllers/wizard/settings/index.js index a1c3c11267..2eaef4fab6 100644 --- a/src/controllers/wizard/settings/index.js +++ b/src/controllers/wizard/settings/index.js @@ -11,7 +11,7 @@ function save(page) { config.MetadataCountryCode = page.querySelector('#selectCountry').value; apiClient.ajax({ type: 'POST', - data: config, + data: JSON.stringify(config), url: apiClient.getUrl('Startup/Configuration') }).then(function () { loading.hide(); diff --git a/src/controllers/wizard/start/index.js b/src/controllers/wizard/start/index.js index cec93446db..8c147fc75e 100644 --- a/src/controllers/wizard/start/index.js +++ b/src/controllers/wizard/start/index.js @@ -17,7 +17,7 @@ function save(page) { config.UICulture = $('#selectLocalizationLanguage', page).val(); apiClient.ajax({ type: 'POST', - data: config, + data: JSON.stringify(config), url: apiClient.getUrl('Startup/Configuration') }).then(function () { Dashboard.navigate('wizarduser.html'); diff --git a/src/controllers/wizard/user/index.js b/src/controllers/wizard/user/index.js index 855086a3a4..fc9a27855f 100644 --- a/src/controllers/wizard/user/index.js +++ b/src/controllers/wizard/user/index.js @@ -23,10 +23,10 @@ function submit(form) { const apiClient = getApiClient(); apiClient.ajax({ type: 'POST', - data: { + data: JSON.stringify({ Name: form.querySelector('#txtUsername').value, Password: form.querySelector('#txtManualPassword').value - }, + }), url: apiClient.getUrl('Startup/User') }).then(onUpdateUserComplete); }