mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use JSON when POSTing data
This commit is contained in:
parent
784f9fcc32
commit
3359fc388b
9 changed files with 15 additions and 15 deletions
|
@ -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');
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue