diff --git a/src/api/service/group-service/index.ts b/src/api/service/group-service/index.ts index cf6d754b..38bfa8c8 100644 --- a/src/api/service/group-service/index.ts +++ b/src/api/service/group-service/index.ts @@ -33,6 +33,24 @@ export const groupServiceRemote = () => ({ params.append('cursor', payload.cursor.toString()); } params.append('size', payload.size.toString()); + if (payload.filter) { + params.append('filter', payload.filter); + } + if (payload.includeStatuses && payload.includeStatuses.length > 0) { + payload.includeStatuses.forEach((status) => { + params.append('includeStatuses', status); + }); + } + if (payload.excludeStatuses && payload.excludeStatuses.length > 0) { + payload.excludeStatuses.forEach((status) => { + params.append('excludeStatuses', status); + }); + } + if (payload.myStatuses && payload.myStatuses.length > 0) { + payload.myStatuses.forEach((status) => { + params.append('myStatuses', status); + }); + } return apiV2.get(`/groups/me?${params.toString()}`); }, diff --git a/src/app/schedule/(components)/current.tsx b/src/app/schedule/_components/current.tsx similarity index 100% rename from src/app/schedule/(components)/current.tsx rename to src/app/schedule/_components/current.tsx diff --git a/src/app/schedule/(components)/history.tsx b/src/app/schedule/_components/history.tsx similarity index 90% rename from src/app/schedule/(components)/history.tsx rename to src/app/schedule/_components/history.tsx index cee6eb48..f7773e04 100644 --- a/src/app/schedule/(components)/history.tsx +++ b/src/app/schedule/_components/history.tsx @@ -12,7 +12,12 @@ export default function History() { const { items, error, fetchNextPage, hasNextPage, isFetchingNextPage, completedMessage } = useInfiniteScroll({ queryFn: async ({ cursor, size }) => { - return await API.groupService.getMyGroups({ type: 'past', cursor, size }); + return await API.groupService.getMyGroups({ + type: 'past', + cursor, + size, + filter: 'ALL', + }); }, queryKey: ['myGroups', 'past'], pageSize: 10, diff --git a/src/app/schedule/(components)/meeting-list.tsx b/src/app/schedule/_components/meeting-list.tsx similarity index 99% rename from src/app/schedule/(components)/meeting-list.tsx rename to src/app/schedule/_components/meeting-list.tsx index 44b716ec..e632bdb5 100644 --- a/src/app/schedule/(components)/meeting-list.tsx +++ b/src/app/schedule/_components/meeting-list.tsx @@ -143,3 +143,5 @@ export const MeetingList = ({ ); }; + +// diff --git a/src/app/schedule/(components)/my.tsx b/src/app/schedule/_components/my.tsx similarity index 90% rename from src/app/schedule/(components)/my.tsx rename to src/app/schedule/_components/my.tsx index ac671f9a..d715ada0 100644 --- a/src/app/schedule/(components)/my.tsx +++ b/src/app/schedule/_components/my.tsx @@ -12,7 +12,12 @@ export default function My() { const { items, error, fetchNextPage, hasNextPage, isFetchingNextPage, completedMessage } = useInfiniteScroll({ queryFn: async ({ cursor, size }) => { - return await API.groupService.getMyGroups({ type: 'myPost', cursor, size }); + return await API.groupService.getMyGroups({ + type: 'myPost', + cursor, + size, + filter: 'ALL', + }); }, queryKey: ['myGroups', 'myPost'], pageSize: 10, diff --git a/src/app/schedule/page.tsx b/src/app/schedule/page.tsx index 473283cc..4e539d3d 100644 --- a/src/app/schedule/page.tsx +++ b/src/app/schedule/page.tsx @@ -6,9 +6,9 @@ import { Suspense } from 'react'; import { TabNavigation } from '@/components/shared'; -import Current from './(components)/current'; -import History from './(components)/history'; -import My from './(components)/my'; +import Current from './_components/current'; +import History from './_components/history'; +import My from './_components/my'; const SCHEDULE_TABS = [ { label: '현재 모임', value: 'current' }, @@ -40,8 +40,3 @@ export default function SchedulePage() { ); } - -// 나중에 api 연동할 때 -// 1. ScheduleContent를 감싸던 임시 Suspense 제거해야됨 -// 2. useSearchParams()는 그대로 유지 -// 3. Current, My, History를 서버 컴포넌트로 변경 (use client 제거) - 서버에서 데이터 페칭