mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
UI Updates (Cancel Import, Move Artist, Manual Import from Artist)
Ability to cancel an import lookup/search at any point. Ability to move artist path from Artist Edit or bulk move from Mass Editor. Trigger manual import for Artist path from Artist Detail page. Pulled from Sonarr
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import $ from 'jquery';
|
||||
import { batchActions } from 'redux-batched-actions';
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
import getProviderState from 'Utilities/State/getProviderState';
|
||||
@@ -14,15 +15,19 @@ export function createCancelSaveProviderHandler(section) {
|
||||
};
|
||||
}
|
||||
|
||||
function createSaveProviderHandler(section, url) {
|
||||
function createSaveProviderHandler(section, url, options = {}) {
|
||||
return function(getState, payload, dispatch) {
|
||||
dispatch(set({ section, isSaving: true }));
|
||||
|
||||
const id = payload.id;
|
||||
const {
|
||||
id,
|
||||
queryParams = {}
|
||||
} = payload;
|
||||
|
||||
const saveData = getProviderState(payload, getState, section);
|
||||
|
||||
const ajaxOptions = {
|
||||
url,
|
||||
url: `${url}?${$.param(queryParams, true)}`,
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
@@ -30,7 +35,7 @@ function createSaveProviderHandler(section, url) {
|
||||
};
|
||||
|
||||
if (id) {
|
||||
ajaxOptions.url = `${url}/${id}`;
|
||||
ajaxOptions.url = `${url}/${id}?${$.param(queryParams, true)}`;
|
||||
ajaxOptions.method = 'PUT';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user