🤼♀️ Ability to apply a select ComicVine match first draft
This commit is contained in:
@@ -2,11 +2,16 @@ import {
|
||||
CV_API_CALL_IN_PROGRESS,
|
||||
CV_SEARCH_SUCCESS,
|
||||
CV_CLEANUP,
|
||||
IMS_COMIC_BOOK_DB_OBJECT_FETCHED,
|
||||
IMS_COMIC_BOOK_DB_OBJECT_CALL_IN_PROGRESS,
|
||||
IMS_COMIC_BOOK_DB_OBJECT_CALL_FAILED,
|
||||
} from "../constants/action-types";
|
||||
const initialState = {
|
||||
searchResults: [],
|
||||
searchQuery: {},
|
||||
inProgress: false,
|
||||
comicBookDetail: {},
|
||||
IMS_inProgress: false,
|
||||
};
|
||||
|
||||
function comicinfoReducer(state = initialState, action) {
|
||||
@@ -17,17 +22,29 @@ function comicinfoReducer(state = initialState, action) {
|
||||
inProgress: true,
|
||||
};
|
||||
case CV_SEARCH_SUCCESS:
|
||||
console.log("ASDASD", action)
|
||||
return {
|
||||
...state,
|
||||
searchResults: action.searchResults,
|
||||
searchQuery: action.searchQueryObject,
|
||||
inProgress: false,
|
||||
};
|
||||
case IMS_COMIC_BOOK_DB_OBJECT_CALL_IN_PROGRESS:
|
||||
return {
|
||||
...state,
|
||||
IMS_inProgress: true,
|
||||
};
|
||||
|
||||
case IMS_COMIC_BOOK_DB_OBJECT_FETCHED:
|
||||
return {
|
||||
...state,
|
||||
comicBookDetail: action.comicBookDetail,
|
||||
IMS_inProgress: false,
|
||||
};
|
||||
case CV_CLEANUP:
|
||||
return {
|
||||
searchResults: [],
|
||||
searchQuery: {},
|
||||
comicBookDetail: {},
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user