diff --git a/packages/web-domains/src/result/common/apis/queries/useGetMeetings.ts b/packages/web-domains/src/result/common/apis/queries/useGetMeetings.ts deleted file mode 100644 index effd2dd2..00000000 --- a/packages/web-domains/src/result/common/apis/queries/useGetMeetings.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'; - -import { Http } from '@/common/apis/base.api'; - -import { MeetingResponse } from '../schema/MeetingResponse'; - -interface QueryProps { - options?: UseQueryOptions; -} - -export const MEETINGS_QUERY_KEY = 'MEETINGS_QUERY_KEY'; - -const queryFn = () => Http.GET(`/v1/meetings`); - -export const useGetMeetings = (props: QueryProps = {}) => { - const { options } = props; - - return useQuery({ - queryKey: [MEETINGS_QUERY_KEY], - queryFn, - ...options, - }); -}; - -interface PrefetchProps { - queryClient: QueryClient; -} - -export const getMeetingsPrefetch = (props: PrefetchProps) => { - const { queryClient } = props; - - const prefetch = queryClient.prefetchQuery({ - queryKey: [MEETINGS_QUERY_KEY], - queryFn, - }); - - return prefetch; -}; diff --git a/packages/web-domains/src/result/common/apis/schema/MeetingResponse.ts b/packages/web-domains/src/result/common/apis/schema/MeetingResponse.ts deleted file mode 100644 index 048d0087..00000000 --- a/packages/web-domains/src/result/common/apis/schema/MeetingResponse.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MeetingResponse { - meetings: Array<{ meetingId: number; name: string }>; -} diff --git a/packages/web-domains/src/result/features/list/screens/AnswerListScreen.tsx b/packages/web-domains/src/result/features/list/screens/AnswerListScreen.tsx index 74db0322..7d6e0d49 100644 --- a/packages/web-domains/src/result/features/list/screens/AnswerListScreen.tsx +++ b/packages/web-domains/src/result/features/list/screens/AnswerListScreen.tsx @@ -1,7 +1,6 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; import { getAnswersPrefetch } from '@/result/common/apis/queries/useGetAnswers'; -import { getMeetingsPrefetch } from '@/result/common/apis/queries/useGetMeetings'; import { BaseParams } from '@/result/common/types/BaseParams'; import { AnswerListContainer } from '../containers/AnswerListContainer'; @@ -20,8 +19,6 @@ const getServerSideProps = async (params: BaseParams) => { const queryClient = new QueryClient(); try { - await getMeetingsPrefetch({ queryClient }); - await getAnswersPrefetch({ queryClient, meetingId: Number(params.meetingId), diff --git a/packages/web-domains/src/result/features/list/screens/MostSelectedListScreen.tsx b/packages/web-domains/src/result/features/list/screens/MostSelectedListScreen.tsx index 3e84b57b..1aadf8f3 100644 --- a/packages/web-domains/src/result/features/list/screens/MostSelectedListScreen.tsx +++ b/packages/web-domains/src/result/features/list/screens/MostSelectedListScreen.tsx @@ -1,6 +1,5 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; -import { getMeetingsPrefetch } from '@/result/common/apis/queries/useGetMeetings'; import { getMostSelectedPrefetch } from '@/result/common/apis/queries/useGetMostSelected'; import { BaseParams } from '@/result/common/types/BaseParams'; @@ -20,7 +19,6 @@ const getServerSideProps = async (params: BaseParams) => { const queryClient = new QueryClient(); try { - await getMeetingsPrefetch({ queryClient }); await getMostSelectedPrefetch({ queryClient, meetingId: Number(params.meetingId), diff --git a/packages/web-domains/src/result/features/list/screens/SelectedSameListScreen.tsx b/packages/web-domains/src/result/features/list/screens/SelectedSameListScreen.tsx index 43a1d4ae..f0e8f607 100644 --- a/packages/web-domains/src/result/features/list/screens/SelectedSameListScreen.tsx +++ b/packages/web-domains/src/result/features/list/screens/SelectedSameListScreen.tsx @@ -1,6 +1,5 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; -import { getMeetingsPrefetch } from '@/result/common/apis/queries/useGetMeetings'; import { getSameSelectedPrefetch } from '@/result/common/apis/queries/useGetSameSelected'; import { BaseParams } from '@/result/common/types/BaseParams'; @@ -20,7 +19,6 @@ const getServerSideProps = async (params: BaseParams) => { const queryClient = new QueryClient(); try { - await getMeetingsPrefetch({ queryClient }); await getSameSelectedPrefetch({ queryClient, meetingId: Number(params.meetingId), diff --git a/packages/web-domains/src/result/features/main/screens/ResultMainScreen.tsx b/packages/web-domains/src/result/features/main/screens/ResultMainScreen.tsx index 67d708fd..c8dd7ed1 100644 --- a/packages/web-domains/src/result/features/main/screens/ResultMainScreen.tsx +++ b/packages/web-domains/src/result/features/main/screens/ResultMainScreen.tsx @@ -2,7 +2,6 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query import { getCommentsPrefetch } from '@/result/common/apis/queries/useGetComments'; import { getDetailedQuestionDataPrefetch } from '@/result/common/apis/queries/useGetDetailedQuestionData'; -import { getMeetingsPrefetch } from '@/result/common/apis/queries/useGetMeetings'; import { getMostSelectedPrefetch } from '@/result/common/apis/queries/useGetMostSelected'; import { getSameSelectedPrefetch } from '@/result/common/apis/queries/useGetSameSelected'; import { BaseLayout } from '@/result/common/components'; @@ -28,10 +27,7 @@ const getServerSideProps = async (params: BaseParams) => { const queryClient = new QueryClient(); try { - await getMeetingsPrefetch({ queryClient }); - const prefetchParams = { queryClient, meetingId: Number(params.meetingId), questionId: Number(params.questionId) }; - await Promise.all([ getMostSelectedPrefetch(prefetchParams), getSameSelectedPrefetch(prefetchParams),