From 652d31b20e805e25c85fc4ba1f96210c5846276c Mon Sep 17 00:00:00 2001 From: Richard Pentecost Date: Thu, 18 Jan 2024 11:50:28 +0000 Subject: [PATCH] add taskProps to ProjectInteraction.jsx to prevent errors --- .../components/CollectionList/index.jsx | 39 +++++++++---------- .../Projects/ProjectInteractions.jsx | 29 ++++++++++---- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/client/components/CollectionList/index.jsx b/src/client/components/CollectionList/index.jsx index 5529b9ab67e..307936dc245 100644 --- a/src/client/components/CollectionList/index.jsx +++ b/src/client/components/CollectionList/index.jsx @@ -89,27 +89,24 @@ const CollectionList = ({ ) )} - {taskProps && ( - - {() => - isComplete && ( - <> -
    - {results.map((item, i) => ( - - ))} -
- - - ) - } -
- )} - {/* )} */} + + {() => + isComplete && ( + <> +
    + {results.map((item, i) => ( + + ))} +
+ + + ) + } +
diff --git a/src/client/modules/Investments/Projects/ProjectInteractions.jsx b/src/client/modules/Investments/Projects/ProjectInteractions.jsx index d6c83824a26..34c1879e965 100644 --- a/src/client/modules/Investments/Projects/ProjectInteractions.jsx +++ b/src/client/modules/Investments/Projects/ProjectInteractions.jsx @@ -12,6 +12,8 @@ import { } from '../../../components/Resource' import urls from '../../../../lib/urls' import ProjectLayout from '../../../components/Layout/ProjectLayout' +import { INTERACTIONS__LOADED } from '../../../actions' +import { TASK_GET_INTERACTIONS_LIST } from '../../Interactions/CollectionList/state' const ProjectInteractions = () => { const history = useHistory() @@ -20,15 +22,25 @@ const ProjectInteractions = () => { const activePage = parseInt(parsedQueryString.page, 10) || 1 const { projectId } = useParams() + + const payload = { + investment_project_id: projectId, + limit: 10, + offset: activePage * 10 - 10, + sortby: parsedQueryString.sortby, + } + + const collectionListTask = { + name: TASK_GET_INTERACTIONS_LIST, + id: projectId, + progressMessage: 'Loading interactions', + startOnRender: { + payload: payload, + onSuccessDispatch: INTERACTIONS__LOADED, + }, + } return ( - + {(_, count, rawData) => { const interactions = rawData.results.map(transformInteractionToListItem) const sortOptions = [ @@ -74,6 +86,7 @@ const ProjectInteractions = () => { }), }) } + taskProps={collectionListTask} activePage={activePage} sortOptions={count ? sortOptions : null} addItemUrl={urls.investments.projects.interactions.createType(