Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/api/service/group-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetMyGroupsResponse>(`/groups/me?${params.toString()}`);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export default function History() {
const { items, error, fetchNextPage, hasNextPage, isFetchingNextPage, completedMessage } =
useInfiniteScroll<GroupListItemResponse, ['myGroups', 'past']>({
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ export const MeetingList = ({
</section>
);
};

//
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export default function My() {
const { items, error, fetchNextPage, hasNextPage, isFetchingNextPage, completedMessage } =
useInfiniteScroll<GroupListItemResponse, ['myGroups', 'myPost']>({
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,
Expand Down
11 changes: 3 additions & 8 deletions src/app/schedule/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -40,8 +40,3 @@ export default function SchedulePage() {
</div>
);
}

// 나중에 api 연동할 때
// 1. ScheduleContent를 감싸던 임시 Suspense 제거해야됨
// 2. useSearchParams()는 그대로 유지
// 3. Current, My, History를 서버 컴포넌트로 변경 (use client 제거) - 서버에서 데이터 페칭