🔧 Refactored the volumeGroup to use volume info from mongo
This commit is contained in:
@@ -148,7 +148,7 @@ export const fetchVolumeGroups = () => (dispatch) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: IMS_COMIC_BOOK_GROUPS_FETCHED,
|
type: IMS_COMIC_BOOK_GROUPS_FETCHED,
|
||||||
data,
|
data: data.data,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import React, { ReactElement, useCallback, useContext } from "react";
|
import React, { ReactElement, useCallback, useContext } from "react";
|
||||||
import { isEmpty, isNil, isUndefined } from "lodash";
|
import { isEmpty } from "lodash";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { fetchComicBookMetadata } from "../actions/fileops.actions";
|
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 DynamicList, { createCache } from "react-window-dynamic-list";
|
||||||
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
|
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
|
||||||
import Loader from "react-loader-spinner";
|
import Loader from "react-loader-spinner";
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const VolumeGroups = (): ReactElement => {
|
|||||||
const volumeGroups = useSelector(
|
const volumeGroups = useSelector(
|
||||||
(state: RootState) => state.fileOps.comicVolumeGroups,
|
(state: RootState) => state.fileOps.comicVolumeGroups,
|
||||||
);
|
);
|
||||||
|
console.log(volumeGroups);
|
||||||
return (
|
return (
|
||||||
<section className="volumes-container mt-4">
|
<section className="volumes-container mt-4">
|
||||||
<div className="content">
|
<div className="content">
|
||||||
@@ -33,22 +34,22 @@ export const VolumeGroups = (): ReactElement => {
|
|||||||
>
|
>
|
||||||
{!isNil(volumeGroups) &&
|
{!isNil(volumeGroups) &&
|
||||||
volumeGroups &&
|
volumeGroups &&
|
||||||
map(volumeGroups.data, (group) => {
|
map(volumeGroups, (group) => {
|
||||||
if (!isNil(group)) {
|
if (!isNil(group._id)) {
|
||||||
return (
|
return (
|
||||||
<div className="stack" key={group.results.id}>
|
<div className="stack" key={group._id.id}>
|
||||||
<img src={group.results.image.small_url} />
|
<img src={group.data[0].image.small_url} />
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<div className="stack-title is-size-8">
|
<div className="stack-title is-size-8">
|
||||||
<Link to={`/volume/details/${group.comicObjectId}`}>
|
<Link to={`/volume/details/${group.comicBookObjectId}`}>
|
||||||
{ellipsize(group.results.name, 18)}
|
{ellipsize(group.data[0].name, 18)}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="control">
|
<div className="control">
|
||||||
<span className="tags has-addons">
|
<span className="tags has-addons">
|
||||||
<span className="tag is-primary is-light">Issues</span>
|
<span className="tag is-primary is-light">Issues</span>
|
||||||
<span className="tag">
|
<span className="tag">
|
||||||
{group.results.count_of_issues}
|
{group.data[0].count_of_issues}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ function fileOpsReducer(state = initialState, action) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
case IMS_COMIC_BOOK_GROUPS_FETCHED: {
|
case IMS_COMIC_BOOK_GROUPS_FETCHED: {
|
||||||
|
console.log(action)
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
comicVolumeGroups: action.data,
|
comicVolumeGroups: action.data,
|
||||||
|
|||||||
Reference in New Issue
Block a user