mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Ability to test all Indexers, Lists, Clients
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
import { set } from '../baseActions';
|
||||
|
||||
function createTestAllProvidersHandler(section, url) {
|
||||
return function(getState, payload, dispatch) {
|
||||
dispatch(set({ section, isTestingAll: true }));
|
||||
|
||||
const ajaxOptions = {
|
||||
url: `${url}/testall`,
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json'
|
||||
};
|
||||
|
||||
const { request } = createAjaxRequest(ajaxOptions);
|
||||
|
||||
request.done((data) => {
|
||||
dispatch(set({
|
||||
section,
|
||||
isTestingAll: false,
|
||||
saveError: null
|
||||
}));
|
||||
});
|
||||
|
||||
request.fail((xhr) => {
|
||||
dispatch(set({
|
||||
section,
|
||||
isTestingAll: false
|
||||
}));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default createTestAllProvidersHandler;
|
||||
Reference in New Issue
Block a user