From ce392ec13e781d93c7e9dfbdc838eb28f1633a60 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Sat, 12 Feb 2022 19:41:47 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Refactored=20the=20volumeGroup?= =?UTF-8?q?=20to=20use=20volume=20info=20from=20mongo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/actions/fileops.actions.tsx | 2 +- src/client/components/Import.tsx | 4 +--- src/client/components/VolumeGroups.tsx | 15 ++++++++------- src/client/reducers/fileops.reducer.ts | 1 + 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 0301428..dfbc5f6 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -148,7 +148,7 @@ export const fetchVolumeGroups = () => (dispatch) => { .then((data) => { dispatch({ type: IMS_COMIC_BOOK_GROUPS_FETCHED, - data, + data: data.data, }); }); } catch (error) { diff --git a/src/client/components/Import.tsx b/src/client/components/Import.tsx index 4c48413..40f29e8 100644 --- a/src/client/components/Import.tsx +++ b/src/client/components/Import.tsx @@ -1,9 +1,7 @@ import React, { ReactElement, useCallback, useContext } from "react"; -import { isEmpty, isNil, isUndefined } from "lodash"; +import { isEmpty } from "lodash"; import { useSelector, useDispatch } from "react-redux"; import { fetchComicBookMetadata } from "../actions/fileops.actions"; -import { IFolderData } from "threetwo-ui-typings"; -import { LazyLog, ScrollFollow } from "react-lazylog"; import DynamicList, { createCache } from "react-window-dynamic-list"; import "react-loader-spinner/dist/loader/css/react-spinner-loader.css"; import Loader from "react-loader-spinner"; diff --git a/src/client/components/VolumeGroups.tsx b/src/client/components/VolumeGroups.tsx index e05c544..49fac91 100644 --- a/src/client/components/VolumeGroups.tsx +++ b/src/client/components/VolumeGroups.tsx @@ -20,6 +20,7 @@ export const VolumeGroups = (): ReactElement => { const volumeGroups = useSelector( (state: RootState) => state.fileOps.comicVolumeGroups, ); + console.log(volumeGroups); return (
@@ -33,22 +34,22 @@ export const VolumeGroups = (): ReactElement => { > {!isNil(volumeGroups) && volumeGroups && - map(volumeGroups.data, (group) => { - if (!isNil(group)) { + map(volumeGroups, (group) => { + if (!isNil(group._id)) { return ( -
- +
+
- - {ellipsize(group.results.name, 18)} + + {ellipsize(group.data[0].name, 18)}
Issues - {group.results.count_of_issues} + {group.data[0].count_of_issues}
diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts index c8af742..954e5d4 100644 --- a/src/client/reducers/fileops.reducer.ts +++ b/src/client/reducers/fileops.reducer.ts @@ -89,6 +89,7 @@ function fileOpsReducer(state = initialState, action) { }; } case IMS_COMIC_BOOK_GROUPS_FETCHED: { + console.log(action) return { ...state, comicVolumeGroups: action.data,