🔧 Fixed bugs with tab changes and state

This commit is contained in:
2021-08-24 21:59:59 -07:00
parent 140f690c77
commit 6994da072d
4 changed files with 15 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ export const getComicBooks = (options) => async (dispatch) => {
});
};
export const importToDB = (payload) => (dispatch) => {
export const importToDB = (payload?: any) => (dispatch) => {
try {
const comicBookMetadata = {
importStatus: {
@@ -115,7 +115,7 @@ export const importToDB = (payload) => (dispatch) => {
score: "0",
},
},
sourcedMetadata: { comicvine: payload },
sourcedMetadata: { comicvine: payload || null },
};
dispatch({
type: IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS,
@@ -164,7 +164,10 @@ export const fetchComicVineMatches = (searchPayload) => (dispatch) => {
data: {
format: "json",
sort: "name%3Aasc",
query: issueSearchQuery.searchParams.searchTerms.name,
// hack
query: issueSearchQuery.searchParams.searchTerms.name
.replace(/[^a-zA-Z0-9 ]/g, "")
.trim(),
fieldList: "id",
limit: "20",
offset: "0",