mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
Use react-query for tasks
This commit is contained in:
@@ -18,13 +18,6 @@ const backupsSection = 'system.backups';
|
||||
// State
|
||||
|
||||
export const defaultState = {
|
||||
tasks: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
items: []
|
||||
},
|
||||
|
||||
backups: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
@@ -40,9 +33,6 @@ export const defaultState = {
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_TASK = 'system/tasks/fetchTask';
|
||||
export const FETCH_TASKS = 'system/tasks/fetchTasks';
|
||||
|
||||
export const FETCH_BACKUPS = 'system/backups/fetchBackups';
|
||||
export const RESTORE_BACKUP = 'system/backups/restoreBackup';
|
||||
export const CLEAR_RESTORE_BACKUP = 'system/backups/clearRestoreBackup';
|
||||
@@ -54,9 +44,6 @@ export const SHUTDOWN = 'system/shutdown';
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchTask = createThunk(FETCH_TASK);
|
||||
export const fetchTasks = createThunk(FETCH_TASKS);
|
||||
|
||||
export const fetchBackups = createThunk(FETCH_BACKUPS);
|
||||
export const restoreBackup = createThunk(RESTORE_BACKUP);
|
||||
export const clearRestoreBackup = createAction(CLEAR_RESTORE_BACKUP);
|
||||
@@ -69,9 +56,6 @@ export const shutdown = createThunk(SHUTDOWN);
|
||||
// Action Handlers
|
||||
|
||||
export const actionHandlers = handleThunks({
|
||||
[FETCH_TASK]: createFetchHandler('system.tasks', '/system/task'),
|
||||
[FETCH_TASKS]: createFetchHandler('system.tasks', '/system/task'),
|
||||
|
||||
[FETCH_BACKUPS]: createFetchHandler(backupsSection, '/system/backup'),
|
||||
|
||||
[RESTORE_BACKUP]: function(getState, payload, dispatch) {
|
||||
|
||||
Reference in New Issue
Block a user