Skip to content

Commit

Permalink
feat: remove unnecessary NeurosynthBaseStudiesList type
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed Aug 22, 2023
1 parent 732afa8 commit 99caeaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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<SearchCriteria>, enabled?: boolean) => {
return useQuery(
['studies', { ...searchCriteria }],
Expand Down Expand Up @@ -33,7 +30,7 @@ const useGetBaseStudies = (searchCriteria: Partial<SearchCriteria>, enabled?: bo
{
enabled,
select: (res) => {
const studyList = res.data as unknown as NeurosynthStudyList;
const studyList = res.data;
return studyList;
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -83,7 +83,7 @@ const StudiesPage = () => {
const { user, isLoading: authenticationIsLoading } = useAuth0();

// cached data returned from the api
const [studyData, setStudyData] = useState<NeurosynthStudyList>();
const [studyData, setStudyData] = useState<BaseStudyList>();

// state of the current search
const [searchCriteria, setSearchCriteria] = useState<SearchCriteria>({
Expand Down

0 comments on commit 99caeaa

Please sign in to comment.