🔧 Added caching to pull list call to CV

This commit is contained in:
2022-02-13 22:24:16 -08:00
parent ce392ec13e
commit 1fbf677806
12 changed files with 191 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
import { isEmpty } from "lodash";
import { isEmpty, pull } from "lodash";
import {
CV_API_CALL_IN_PROGRESS,
CV_SEARCH_SUCCESS,
@@ -9,9 +9,12 @@ import {
CV_ISSUES_METADATA_CALL_IN_PROGRESS,
CV_ISSUES_MATCHES_IN_LIBRARY_FETCHED,
CV_ISSUES_FOR_VOLUME_IN_LIBRARY_SUCCESS,
CV_WEEKLY_PULLLIST_FETCHED,
CV_WEEKLY_PULLLIST_CALL_IN_PROGRESS,
} from "../constants/action-types";
const initialState = {
pullList: [],
searchResults: [],
searchQuery: {},
inProgress: false,
@@ -97,6 +100,20 @@ function comicinfoReducer(state = initialState, action) {
...state,
issuesForVolume: updatedState,
};
case CV_WEEKLY_PULLLIST_CALL_IN_PROGRESS:
return {
inProgress: true,
...state,
};
case CV_WEEKLY_PULLLIST_FETCHED: {
console.log(action.data);
return {
...state,
inProgress: false,
pullList: [...action.data],
};
}
default:
return state;
}

View File

@@ -89,7 +89,6 @@ function fileOpsReducer(state = initialState, action) {
};
}
case IMS_COMIC_BOOK_GROUPS_FETCHED: {
console.log(action)
return {
...state,
comicVolumeGroups: action.data,