🔧 Clearing previous state's CV results in the drawer
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
IMS_RECENT_COMICS_FETCHED,
|
||||
CV_API_CALL_IN_PROGRESS,
|
||||
CV_SEARCH_SUCCESS,
|
||||
CV_CLEANUP,
|
||||
} from "../constants/action-types";
|
||||
|
||||
import { refineQuery } from "../shared/utils/nlp.utils";
|
||||
@@ -37,8 +38,6 @@ export async function walkFolder(path: string): Promise<Array<IFolderData>> {
|
||||
* Used by external plugins
|
||||
*
|
||||
* @param {Object} options
|
||||
* @param {String} options.action login form action
|
||||
* @param {String} [options.errorMessage] optional messaga
|
||||
* @return {Promise<string>} HTML of the page
|
||||
*/
|
||||
export const fetchComicBookMetadata = (options) => async (dispatch) => {
|
||||
@@ -138,10 +137,12 @@ export const fetchComicVineMatches = (searchPayload) => (dispatch) => {
|
||||
},
|
||||
});
|
||||
});
|
||||
{
|
||||
/* return { issueSearchQuery, series: seriesSearchQuery.searchParams }; */
|
||||
}
|
||||
|
||||
/* return { issueSearchQuery, series: seriesSearchQuery.searchParams }; */
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
dispatch({
|
||||
type: "CV_CLEANUP",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -4,7 +4,6 @@ import axios from "axios";
|
||||
import Card from "./Card";
|
||||
import MatchResult from "./MatchResult";
|
||||
import ComicVineSearchForm from "./ComicVineSearchForm";
|
||||
import Collapsible from "react-collapsible";
|
||||
import { Divider } from "antd";
|
||||
import { isEmpty, isUndefined } from "lodash";
|
||||
import { IExtractedComicBookCoverFile, RootState } from "threetwo-ui-typings";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const CV_API_CALL_IN_PROGRESS = "CV_SEARCH_IN_PROGRESS";
|
||||
export const CV_SEARCH_FAILURE = "CV_SEARCH_FAILURE";
|
||||
export const CV_SEARCH_SUCCESS = "CV_SEARCH_SUCCESS";
|
||||
export const CV_CLEANUP = "CV_CLEANUP";
|
||||
|
||||
export const CV_API_GENERIC_FAILURE = "CV_API_GENERIC_FAILURE";
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
CV_API_CALL_IN_PROGRESS,
|
||||
CV_SEARCH_SUCCESS,
|
||||
CV_CLEANUP,
|
||||
} from "../constants/action-types";
|
||||
const initialState = {
|
||||
searchResults: [],
|
||||
@@ -15,12 +16,13 @@ function comicinfoReducer(state = initialState, action) {
|
||||
result: {},
|
||||
};
|
||||
case CV_SEARCH_SUCCESS:
|
||||
console.log(action);
|
||||
return {
|
||||
...state,
|
||||
searchResults: action.searchResults.results,
|
||||
searchQuery: action.searchQueryObject,
|
||||
};
|
||||
case CV_CLEANUP:
|
||||
return initialState;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user