From 99caeaadccc126790c39fd0426e3ce84b2e2a723 Mon Sep 17 00:00:00 2001 From: Nicholas Lee Date: Tue, 22 Aug 2023 17:34:46 -0400 Subject: [PATCH] feat: remove unnecessary NeurosynthBaseStudiesList type --- .../src/hooks/studies/useGetBaseStudies.tsx | 5 +---- .../src/pages/Studies/StudiesPage/StudiesPage.tsx | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/compose/neurosynth-frontend/src/hooks/studies/useGetBaseStudies.tsx b/compose/neurosynth-frontend/src/hooks/studies/useGetBaseStudies.tsx index aca405213..ba4a64b1f 100644 --- a/compose/neurosynth-frontend/src/hooks/studies/useGetBaseStudies.tsx +++ b/compose/neurosynth-frontend/src/hooks/studies/useGetBaseStudies.tsx @@ -1,10 +1,7 @@ -import { BaseStudyList } from 'neurostore-typescript-sdk'; import { SearchCriteria, SearchDataType, Source } from 'pages/Studies/StudiesPage/StudiesPage'; import { useQuery } from 'react-query'; import API from 'utils/api'; -export type NeurosynthStudyList = BaseStudyList & { metadata: { total_count: number } }; - const useGetBaseStudies = (searchCriteria: Partial, enabled?: boolean) => { return useQuery( ['studies', { ...searchCriteria }], @@ -33,7 +30,7 @@ const useGetBaseStudies = (searchCriteria: Partial, enabled?: bo { enabled, select: (res) => { - const studyList = res.data as unknown as NeurosynthStudyList; + const studyList = res.data; return studyList; }, } diff --git a/compose/neurosynth-frontend/src/pages/Studies/StudiesPage/StudiesPage.tsx b/compose/neurosynth-frontend/src/pages/Studies/StudiesPage/StudiesPage.tsx index 6a1ccdf07..220624eae 100644 --- a/compose/neurosynth-frontend/src/pages/Studies/StudiesPage/StudiesPage.tsx +++ b/compose/neurosynth-frontend/src/pages/Studies/StudiesPage/StudiesPage.tsx @@ -6,8 +6,8 @@ import StateHandlerComponent from 'components/StateHandlerComponent/StateHandler import NeurosynthTable from 'components/Tables/NeurosynthTable/NeurosynthTable'; import NeurosynthTableStyles from 'components/Tables/NeurosynthTable/NeurosynthTable.styles'; import { useGetBaseStudies } from 'hooks'; -import { NeurosynthStudyList } from 'hooks/studies/useGetBaseStudies'; import useGetTour from 'hooks/useGetTour'; +import { BaseStudyList } from 'neurostore-typescript-sdk'; import { addKVPToSearch, getSearchCriteriaFromURL, @@ -83,7 +83,7 @@ const StudiesPage = () => { const { user, isLoading: authenticationIsLoading } = useAuth0(); // cached data returned from the api - const [studyData, setStudyData] = useState(); + const [studyData, setStudyData] = useState(); // state of the current search const [searchCriteria, setSearchCriteria] = useState({