Skip to content

[FEAT/#106] 메인 화면 API 연동 및 제휴 목록 상태 UI 처리#112

Open
chunjaemin wants to merge 4 commits into
developfrom
feat/#106-mainpage-api-sync
Open

[FEAT/#106] 메인 화면 API 연동 및 제휴 목록 상태 UI 처리#112
chunjaemin wants to merge 4 commits into
developfrom
feat/#106-mainpage-api-sync

Conversation

@chunjaemin
Copy link
Copy Markdown
Contributor

📝 요약

  • 파트너십 도메인 API 타입, 어댑터, React Query 훅 구현
  • axios-mock-adapter 핸들러로 admin/partner/partnership 엔드포인트 목데이터 연결
  • 메인 화면 제휴 목록에 최대 3개 제한 및 에러/빈 상태 UI 추가

⚙️ 작업 내용

  • entities/partnership에 API DTO 타입, 어댑터 함수, React Query 훅 구현
  • mock 핸들러 3종 구현 (admin/partner/partnership), ACTIVE/INACTIVE/SUSPEND 상태 포함한 목데이터 세팅
  • PartnershipListWidget을 순수 display 컴포넌트로 설계 (fetch 상태 무관)
  • 페이지 레벨(Early Return 패턴)에서 isError / empty 분기 처리
  • maxItems prop으로 메인 화면 최대 3개 노출 제한
  • ADR 문서 2건 작성 (비동기 상태 처리 패턴, Widget 설계 원칙)

🔗 관련 이슈

✅ 체크리스트

  • 코딩 컨벤션(Biome/Lint)을 준수하였습니다.
  • 모든 타입 에러를 해결하였습니다. (Typecheck)
  • 변경 사항에 대한 테스트를 마쳤습니다.
  • 불필요한 로그(console.log)를 제거하였습니다.

💬 리뷰어에게

  • Widget 설계 원칙(ADR-002)에 따라 PartnershipListWidget에서 isError prop을 제거하고 페이지에서 Early Return 패턴으로 처리했습니다. 관련 근거는 docs/decisions/에 정리했어요.
  • mock 데이터는 ACTIVE/INACTIVE/SUSPEND 3가지 상태를 모두 포함하고 있습니다.

@github-actions github-actions Bot added docs README나 WIKI 등의 문서 개정 feature 새로운 기능 구현 labels May 24, 2026
@github-actions
Copy link
Copy Markdown

Thanks for the contribution!
I have applied any labels matching special text in your title and description.

Please review the labels and make any necessary changes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the partnership management system to replace mock data with actual API integrations using TanStack Query, guided by new architectural decisions (ADR-001 and ADR-002) that promote early return patterns for async states and pure display widgets. The changes introduce new API hooks, data adapters, and updated UI components for admin and partner homepages. Review feedback identifies missing data mappings in adapters for contract and recommendation details, a logic error in the maxItems prop handling within PartnershipListWidget, and a missing loading state in AdminHomePage that could degrade the user experience.

Comment on lines +86 to +87
companyName: "",
proposerName: "",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

PartnershipContract 타입에서 요구하는 companyName과 proposerName 필드가 DTO(PartnershipDetailResponseDTO)에 존재하지 않아 빈 문자열로 하드코딩되어 있습니다. 이로 인해 상세 화면에서 해당 정보가 누락될 수 있습니다. API 응답에 해당 필드를 추가하거나, 모델 정의를 선택적(optional)으로 변경하는 것을 검토해 주세요.

Comment on lines +95 to +106
export function toAdminAffiliationSummary(
dto: AdminRecommendResponseDTO,
): AdminAffiliationSummary {
const addressParts = [dto.partnerAddress, dto.partnerDetailAddress].filter(
Boolean,
);
return {
title: dto.partnerName,
address: addressParts.join(" "),
partnerUrl: dto.partnerUrl,
};
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

toAdminAffiliationSummary 함수에서 AdminAffiliationSummary 인터페이스의 status와 dateRange 필드를 설정하지 않고 있습니다. 기존 목데이터 기반 구현에서는 이 필드들을 활용해 '제휴 계약서 보기' 또는 '문의하기' 버튼 분기 처리를 수행했는데, 현재는 정보가 누락되어 항상 기본값('문의하기')으로만 노출될 것으로 보입니다. DTO에 관련 필드를 추가하여 연동하는 것이 좋겠습니다.

onViewAll,
onPressCard,
}: PartnershipListWidgetProps) => {
const displayed = maxItems ? partnerships.slice(0, maxItems) : partnerships;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

maxItems가 0일 경우 falsy한 값으로 취급되어 partnerships 전체가 노출되는 문제가 발생할 수 있습니다. undefined 여부를 명확히 체크하는 것이 안전합니다.

Suggested change
const displayed = maxItems ? partnerships.slice(0, maxItems) : partnerships;
const displayed = maxItems !== undefined ? partnerships.slice(0, maxItems) : partnerships;
References
  1. When creating reusable UI blocks (widgets), design them as presentational components that receive data via props to separate UI from business logic.

Comment on lines +71 to +73
const { data: partnershipsData, isError: isPartnershipsError } =
useAdminPartnerships();
const partnerships = partnershipsData?.content.map(toPartnership) ?? [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

데이터 로딩 중(isLoading)에 대한 처리가 누락되어 있습니다. 현재 로직으로는 로딩 중에 partnerships가 빈 배열([])이 되어, 실제 데이터가 있음에도 불구하고 '진행 중인 제휴가 없어요.'라는 EmptyState가 잠시 노출되는 UX 문제가 발생할 수 있습니다. 로딩 상태에 대한 처리를 추가하는 것을 권장합니다.

References
  1. Ensure that user-facing text maintains correct spelling, grammar, and consistent punctuation, especially regarding sentence-ending punctuation like adding a period.

Copy link
Copy Markdown
Contributor

@ahcgnoej ahcgnoej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api폴더 내부와 model/api-types.ts에 들어있는 DTO 인터페이스들, 엔드포인트 주소 매핑과 useQuery바이딩 하는것 등등은 스웨거 openapi 명세 기반으로 스크립트 사용하여 자동화 시킬수 있을 거 같은데 혹시 어떻게 생각하시나요! 폴더 구조나 작성 컨벤션만 더 정하면 스크립트 수정할 수 있을 거 같은데 의견 부탁드립니다

@chunjaemin chunjaemin self-assigned this May 25, 2026
@chunjaemin chunjaemin removed the docs README나 WIKI 등의 문서 개정 label May 25, 2026
Copy link
Copy Markdown
Contributor

@taegeon2 taegeon2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

admins: AdminLiteDTO[];
}

export interface BaseResponse<T> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 API에서 공통적으로 사용하게 될테니 shared/types/api.ts로 옮기는건 어떨까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은생각 같습니다 shared로 빼둘게욥

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PartnerListPage.tsx에 에러처리 관련 로직을 넣어두면 좋을거같습니다.

@taegeon2 taegeon2 mentioned this pull request May 25, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 새로운 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT/#106] 관리자 메인화면 API 연동

3 participants