You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/frontend/src/Store/Actions/Creators/createTestAllProvidersHandl...

35 lines
768 B

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;