mirror of
https://github.com/Readarr/Readarr
synced 2025-12-30 04:06:53 +01:00
Fixed: Settings fields being altered during save
(cherry picked from commit dd61480d60e067e851982b0cc98f03f752b80673)
This commit is contained in:
parent
93eca6a749
commit
cf42e02586
1 changed files with 10 additions and 0 deletions
|
|
@ -28,6 +28,15 @@ function addApiKey(ajaxOptions) {
|
|||
ajaxOptions.headers['X-Api-Key'] = window.Readarr.apiKey;
|
||||
}
|
||||
|
||||
function addContentType(ajaxOptions) {
|
||||
if (
|
||||
!ajaxOptions.contentType &&
|
||||
ajaxOptions.dataType === 'json' &&
|
||||
(ajaxOptions.method === 'PUT' || ajaxOptions.method === 'POST')) {
|
||||
ajaxOptions.contentType = 'application/json';
|
||||
}
|
||||
}
|
||||
|
||||
export default function createAjaxRequest(originalAjaxOptions) {
|
||||
const requestXHR = new window.XMLHttpRequest();
|
||||
let aborted = false;
|
||||
|
|
@ -46,6 +55,7 @@ export default function createAjaxRequest(originalAjaxOptions) {
|
|||
moveBodyToQuery(ajaxOptions);
|
||||
addRootUrl(ajaxOptions);
|
||||
addApiKey(ajaxOptions);
|
||||
addContentType(ajaxOptions);
|
||||
}
|
||||
|
||||
const request = $.ajax({
|
||||
|
|
|
|||
Loading…
Reference in a new issue