Skip to content

[Feat/#110] 홈 API 연동 - #111

Merged
hyesngy merged 6 commits into
developfrom
feat/#110
Dec 6, 2025
Merged

hyesngy merged 6 commits into
developfrom
feat/#110

Conversation

@hyesngy

@hyesngy hyesngy commented Dec 6, 2025 •

Copy link
Copy Markdown
Member

Summary

관련 있는 Issue를 태그해주세요. (e.g. > - #100)

Tasks

  • favicon 추가
  • 플래시카드 목록 조회 연동
  • 최근 즐겨찾기한 폴더 목록 조회 연동
  • 최근 즐겨찾기한 노트 목록 조회 연동

Screenshot

image

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 홈에 최근 표시된 폴더·노트 및 예정 학습 항목을 실시간 API 데이터로 표시합니다.
    • 카드 정렬·필터링용 API와 관련된 학습 카드 조회 기능을 추가했습니다.
  • UI/UX 개선

    • 파비콘을 표준 ico로 교체했습니다.
    • 홈 페이지 첫 페이지에서 새 폴더 생성 버튼을 숨기도록 동작을 조정했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@hyesngy hyesngy self-assigned this Dec 6, 2025
@hyesngy
hyesngy requested a review from a team as a code owner December 6, 2025 05:19
@hyesngy hyesngy added the ✨ Feature 기능 개발 label Dec 6, 2025
@hyesngy hyesngy linked an issue Dec 6, 2025 that may be closed by this pull request
@vercel

vercel Bot commented Dec 6, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cardify Ready Ready Preview Comment Dec 6, 2025 6:15am

@coderabbitai

coderabbitai Bot commented Dec 6, 2025 •

Copy link
Copy Markdown

Walkthrough

홈 페이지를 모의 데이터에서 실제 API 데이터로 전환합니다. 폴더·노트·카드용 신규 엔드포인트와 API 함수·타입·React Query 헬퍼·훅을 추가하고, favicon을 SVG에서 ico로 교체합니다.

Changes

Cohort / File(s) 변경 요약
앱 루트
index.html
파비콘 링크를 vite.svg에서 favicon.ico로 변경
API 엔드포인트
src/constants/api.ts
GET_RECENT_MARKED_FOLDERS, GET_RECENT_MARKED_NOTES, GET_CARDS_SORT_FILTER 엔드포인트 추가
카드 API 및 타입
src/apis/card/card.ts, src/apis/card/card-queries.ts, src/types/card/*
fetchStudyCards, CARD_QUERY_KEY/CARD_QUERY_OPTION 추가; FetchStudyCardsParams, StudyCard, StudyCardListResponse 및 src/types/card/index.ts 배럴 추가
폴더 API 및 타입
src/apis/folder/folder.ts, src/apis/folder/folder-queries.ts, src/types/folder/folder-response.ts
fetchRecentMarkedFolders 함수 및 FOLDER_QUERY_KEY.RECENT_MARKED/옵션 추가; RecentMarkedFolder, RecentMarkedFoldersResponse 타입 추가
노트 API 및 타입
src/apis/note/note.ts, src/apis/note/note-queries.ts, src/types/note/note-response.ts
fetchRecentMarkedNotes 함수 및 NOTE_QUERY_KEY.RECENT_MARKED/옵션 추가; RecentMarkedNote, RecentMarkedNotesResponse 타입 추가
공통 타입
src/types/common.ts, src/types/index.ts
SortOrder 타입 추가 및 src/types/index.ts에 ./common, ./card 재수출 추가
홈 페이지 훅 및 통합
src/pages/home/hooks/use-home-data.ts, src/pages/home/index.tsx
useRecentMarkedFolders, useRecentMarkedNotes, useScheduledLearningItems 훅 추가; Home 컴포넌트에서 모의 데이터 대신 훅 사용 및 관련 prop 변경
아카이브 폴더 컴포넌트
src/pages/archive/components/MainFolderList/MainFolderList.tsx
NewFolderMain 렌더 조건을 currentPage === 1 → !isHome && currentPage === 1로 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Home as HomeComponent
    participant Hooks as useHomeDataHooks
    participant Query as ReactQuery
    participant API as API_Layer
    participant Server as Backend

    User->>Home: 홈 페이지 요청
    Home->>Hooks: useRecentMarkedFolders(), useRecentMarkedNotes(), useScheduledLearningItems() 호출
    Hooks->>Query: 각각의 QUERY_OPTION 실행
    Query->>API: fetchRecentMarkedFolders(), fetchRecentMarkedNotes(), fetchStudyCards({...})
    API->>Server: GET /folders/recent-marks, /notes/recent-marks, /cards/sort-filter
    Server-->>API: 응답 반환 (RecentMarkedFolders/Notes, StudyCardList)
    API-->>Query: 응답 전달
    Query-->>Hooks: 데이터 전달
    Hooks->>Hooks: mapTo*Props로 매핑
    Hooks-->>Home: 변환된 props 전달
    Home->>User: 컴포넌트 렌더링 후 응답
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 분

  • 주의할 파일:
    • src/pages/home/hooks/use-home-data.ts: 매핑 함수의 타입 안전성 및 기본값 처리
    • src/pages/home/index.tsx: 컴포넌트 prop 변경에 따른 렌더 경로 확인
    • src/apis/card/card-queries.ts / src/apis/card/card.ts: 쿼리 키·파라미터 타입과 엔드포인트 일치 여부
    • src/pages/archive/components/MainFolderList/MainFolderList.tsx: isHome 조건 추가로 인한 렌더링 영향

Possibly related issues

Possibly related PRs

Suggested reviewers

  • daahyunk

Poem

🐰 새벽에 깡총, 코드 밭을 지나,
API 씨앗 심었네, 홈에 물을 주니,
폴더·노트·카드가 하나둘 피어나,
모의는 작별, 실데이터가 인사해요 🌱
껑충껑충, 배포 길도 가볍구나.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 홈 API 연동이라는 주요 변경사항을 명확하게 요약하고 있으며, 이슈 번호 #110과 함께 구체적이고 간결하게 표현되어 있습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으며, 요약, 작업 목록이 모두 포함되어 있고 스크린샷도 첨부되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#110

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fc51a0 and 3fe3bf4.

📒 Files selected for processing (3)
  • src/types/card/card-request.ts (1 hunks)
  • src/types/common.ts (1 hunks)
  • src/types/index.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/types/card/card-request.ts (1)
src/types/common.ts (1)
  • SortOrder (1-1)
🔇 Additional comments (2)
src/types/common.ts (1)

1-1: 정렬 순서 리터럴 타입 정의 적절합니다.

"asc" | "desc" | "edit-newest" | "edit-oldest"로 명시해 둔 덕분에 오타나 잘못된 값 사용을 컴파일 타임에 막을 수 있어 보입니다. 이 PR 범위에서는 추가적인 수정은 없어도 될 것 같습니다.

src/types/index.ts (1)

1-5: 루트 타입 배럴에 common/card를 추가로 노출한 점 좋습니다.

types 엔트리 포인트에서 공통 타입과 카드 관련 타입을 한 번에 가져올 수 있어 import 경로가 단순해집니다. 현재 구조 상 별다른 부작용은 없어 보입니다.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Dec 6, 2025 •

Copy link
Copy Markdown

✨ Storybook 확인: 🔗 https://6785fc0fb0ff9f8d21d80624-lzydfezmta.chromatic.com/

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/pages/home/hooks/use-home-data.ts (2)

8-31: 최근 즐겨찾기 폴더/노트 매핑에서 날짜 필드 의미만 한 번 확인해 주세요.

  • 폴더: createdAt에 folder.markDate를 넣고 있어서, 컴포넌트가 해당 값을 “생성일”로 가정해 표시한다면 실제 의미(최근 즐겨찾기 시점)와 어긋날 수 있습니다.
  • 노트: editDate와 createdAt을 모두 note.markAt으로 채우고 있는데, 리스트 UI가 “수정일 / 생성일”을 구분해 사용한다면 동일 값으로 들어가는 것이 의도인지 모호할 수 있습니다.

홈 전용 뷰에서 “최근 즐겨찾기 일시”를 보여주려는 목적이라면,

  1. prop 이름을 더 의미에 맞게 분리하거나,
  2. 최소한 주석으로 “홈에서는 createdAt/editDate를 즐겨찾기 시점으로 사용”한다고 명시해 두면 이후 헷갈릴 여지가 줄어들 것 같습니다.

33-55: ScheduledLearning 매핑의 하드코딩 값과 필드 의미를 정리해 두는 것이 좋겠습니다.

  • folderId: 0

    • 현재 컴포넌트가 folderId를 사용하지 않는다면 당장은 문제 없겠지만, 나중에 폴더 상세로의 네비게이션 등에 활용될 경우 잘못된 ID로 이어질 수 있습니다. 가능한 경우 백엔드 응답에 폴더 ID를 추가해 타입/매핑을 맞추는 쪽을 고려해 보시면 좋겠습니다.
  • completedCards: card.studyStatus

    • studyStatus가 “완료한 카드 수”인지, 아니면 상태 코드(예: 0/1/2…)인지가 이름만으로는 애매합니다. 만약 상태 코드라면 completedCards 대신 보다 의미를 드러내는 필드명으로 바꾸는 편이 안전합니다.
  • timeReachedCards: 5

    • 완전히 하드코딩된 값이라, 실제 데이터가 들어오기 시작하면 혼동될 수 있습니다. TODO 주석으로 “임시 하드코딩”임을 남기거나, 나중에 API 값으로 교체할 계획이라면 간단히 명시해 두면 유지보수에 도움이 될 것 같습니다.

위 사항들은 기능을 막는 수준은 아니라서 이번 PR에 모두 반영하지 않아도 되지만, 다음 작업 때 한 번 정리해 두시면 좋겠습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99449cd and 8fc51a0.

⛔ Files ignored due to path filters (1)
  • public/favicon.ico is excluded by !**/*.ico
📒 Files selected for processing (17)
  • index.html (1 hunks)
  • src/apis/card/card-queries.ts (1 hunks)
  • src/apis/card/card.ts (1 hunks)
  • src/apis/folder/folder-queries.ts (2 hunks)
  • src/apis/folder/folder.ts (2 hunks)
  • src/apis/note/note-queries.ts (2 hunks)
  • src/apis/note/note.ts (2 hunks)
  • src/constants/api.ts (2 hunks)
  • src/pages/archive/components/MainFolderList/MainFolderList.tsx (1 hunks)
  • src/pages/home/hooks/use-home-data.ts (1 hunks)
  • src/pages/home/index.tsx (2 hunks)
  • src/types/card/card-request.ts (1 hunks)
  • src/types/card/card-response.ts (1 hunks)
  • src/types/card/index.ts (1 hunks)
  • src/types/folder/folder-response.ts (1 hunks)
  • src/types/index.ts (1 hunks)
  • src/types/note/note-response.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (10)
src/types/folder/folder-response.ts (3)
src/pages/archive/components/modal/MoveFolderModal/MoveFolderModal.tsx (1)
  • Folder (7-13)
src/types/folder/folder.ts (1)
  • MainFolderItemProps (1-8)
src/mocks/folder-item-data.ts (1)
  • FolderItemDataProps (3-10)
src/apis/card/card.ts (4)
src/types/card/card-request.ts (1)
  • FetchStudyCardsParams (1-5)
src/apis/common/methods.ts (1)
  • apiGet (3-6)
src/types/card/card-response.ts (1)
  • StudyCardListResponse (12-12)
src/constants/api.ts (1)
  • END_POINTS (1-26)
src/constants/api.ts (1)
src/pages/archive/pages/NotesInsideFolderPage.tsx (1)
  • folder (115-119)
src/types/card/card-response.ts (2)
src/types/home/scheduled-learning.ts (1)
  • ScheduledLearningItemProps (1-9)
src/types/note/note.ts (1)
  • NoteItemProps (1-15)
src/apis/card/card-queries.ts (2)
src/types/card/card-request.ts (1)
  • FetchStudyCardsParams (1-5)
src/apis/card/card.ts (1)
  • fetchStudyCards (5-7)
src/apis/note/note-queries.ts (1)
src/apis/note/note.ts (1)
  • fetchRecentMarkedNotes (62-64)
src/apis/folder/folder.ts (3)
src/apis/common/methods.ts (1)
  • apiGet (3-6)
src/types/folder/folder-response.ts (1)
  • RecentMarkedFoldersResponse (80-80)
src/constants/api.ts (1)
  • END_POINTS (1-26)
src/apis/note/note.ts (2)
src/apis/common/methods.ts (1)
  • apiGet (3-6)
src/types/note/note-response.ts (1)
  • RecentMarkedNotesResponse (75-75)
src/pages/home/hooks/use-home-data.ts (10)
src/utils/folder-mapper.ts (1)
  • mapToMainFolderProps (4-13)
src/types/folder/folder-response.ts (1)
  • RecentMarkedFolder (71-78)
src/pages/archive/components/MainFolderList/MainFolderList.tsx (1)
  • MainFolderProps (9-16)
src/types/note/note-response.ts (1)
  • RecentMarkedNote (63-73)
src/types/note/note.ts (1)
  • NoteItemProps (1-15)
src/types/card/card-response.ts (1)
  • StudyCard (1-10)
src/types/home/scheduled-learning.ts (1)
  • ScheduledLearningItemProps (1-9)
src/apis/folder/folder-queries.ts (1)
  • FOLDER_QUERY_OPTION (12-33)
src/apis/note/note-queries.ts (1)
  • NOTE_QUERY_OPTION (12-23)
src/apis/card/card-queries.ts (1)
  • CARD_QUERY_OPTION (10-16)
src/apis/folder/folder-queries.ts (2)
src/types/folder/folder-request.ts (1)
  • FetchFoldersParams (1-7)
src/apis/folder/folder.ts (1)
  • fetchRecentMarkedFolders (43-45)
🔇 Additional comments (16)
index.html (1)

6-6: Favicon has been properly added.

The favicon.ico file exists in the public directory and the HTML reference at line 6 correctly points to it. No further action is required.

src/types/index.ts (1)

4-4: LGTM!

카드 관련 타입을 중앙 집중식으로 export하는 표준 패턴을 올바르게 따르고 있습니다.

src/apis/note/note-queries.ts (1)

3-3: LGTM!

React Query 패턴을 올바르게 따르고 있으며, 기존 쿼리 정의와 일관성 있게 구현되었습니다.

Also applies to: 9-9, 18-22

src/pages/archive/components/MainFolderList/MainFolderList.tsx (1)

62-62: LGTM!

홈 페이지에서는 NewFolderMain 컴포넌트를 숨기도록 조건부 렌더링이 올바르게 구현되었습니다. 이는 홈 페이지의 읽기 전용 특성에 부합합니다.

src/types/card/index.ts (1)

1-2: LGTM!

카드 타입을 위한 배럴 파일이 표준 패턴에 따라 올바르게 생성되었습니다.

src/apis/note/note.ts (1)

61-64: LGTM!

기존 API 함수들과 동일한 패턴을 따르며, apiGet을 사용하여 최근 즐겨찾기한 노트 목록을 가져오는 함수가 올바르게 구현되었습니다.

src/types/folder/folder-response.ts (2)

75-75: LGTM!

markState에 문자열 리터럴 유니온 타입("ACTIVE" | "INACTIVE")을 사용한 것은 boolean보다 타입 안전성이 높고 명시적이어서 좋은 선택입니다.


71-78: Mapping logic is already implemented.

The naming difference between RecentMarkedFolder (name, color) and MainFolderItemProps (folderName, folderColor) is intentional. This follows a consistent pattern where API response types use generic field names while component props use descriptive ones. The required mapping is already implemented in src/pages/home/hooks/use-home-data.ts (lines 8-13) via the mapToMainFolderProps function, which correctly transforms folder.name → folderName and folder.color → folderColor.

src/constants/api.ts (1)

7-7: Verify these API endpoints against your backend API specification.

The three endpoints defined here (GET_RECENT_MARKED_FOLDERS, GET_RECENT_MARKED_NOTES, GET_CARDS_SORT_FILTER) are all actively used in the frontend code:

  • GET_RECENT_MARKED_FOLDERS → src/apis/folder/folder.ts
  • GET_RECENT_MARKED_NOTES → src/apis/note/note.ts
  • GET_CARDS_SORT_FILTER → src/apis/card/card.ts

Backend API specification is not available in this repository, so cross-reference these endpoint paths and names with your backend API documentation to ensure alignment.

src/apis/folder/folder.ts (1)

10-45: 최근 즐겨찾기 폴더 조회 API 래핑이 일관되고 안전해 보입니다.

RecentMarkedFoldersResponse와 END_POINTS.GET_RECENT_MARKED_FOLDERS를 사용하는 방식이 기존 fetchFolderList 패턴과 잘 맞고, 별도 파라미터도 없어 사용성이 명확합니다. 추가 수정 없이 그대로 사용해도 될 것 같습니다.

src/apis/card/card.ts (1)

1-7: 학습 카드 리스트 API 함수 구현이 타입/엔드포인트와 잘 맞습니다.

FetchStudyCardsParams를 그대로 쿼리 파라미터로 넘기고, 응답을 StudyCardListResponse로 받도록 한 구성이 직관적이고 기존 API 유틸 패턴과도 일관됩니다. 별도 이슈 없어 보입니다.

src/apis/card/card-queries.ts (1)

1-16: 카드 쿼리 키/옵션 구조가 단순하고 확장하기 좋습니다.

CARD_QUERY_KEY.ALL/LIST로 키를 분리하고, LIST에서 params를 키에도 포함시켜 필터 조합별로 캐시를 분리하는 방식이 깔끔합니다. 이후 단건 조회나 기타 옵션이 생겨도 현재 구조에 쉽게 추가할 수 있을 것 같습니다.

src/types/note/note-response.ts (1)

63-75: RecentMarkedNote 타입 정의가 홈 화면 매핑 요구사항과 잘 맞습니다.

noteId/name/folder*/flashCardCount/markState/markAt/noteContentPreview 구성으로 홈 훅에서 NoteItemProps로 매핑하기에 충분한 정보를 담고 있고, 응답 전체를 RecentMarkedNotesResponse = RecentMarkedNote[]로 둔 것도 사용성이 좋습니다. 현재 형태로 무리 없이 활용 가능해 보입니다.

src/types/card/card-response.ts (1)

1-12: StudyCard/StudyCardListResponse 타입이 학습 카드 도메인을 잘 캡처하고 있습니다.

학습 상태(studyStatus), 노트·폴더 메타 정보, 최근/다음 학습일, 즐겨찾기 상태까지 포함되어 있어서 홈의 “지금 학습하기” 섹션 및 향후 정렬/필터링 요구사항을 커버하기에 충분해 보입니다. 별도 수정 없이 그대로 사용해도 무방해 보입니다.

src/apis/folder/folder-queries.ts (1)

3-32: 최근 즐겨찾기 폴더 쿼리 키/옵션이 기존 패턴과 잘 맞습니다.

FOLDER_QUERY_KEY.RECENT_MARKED를 독립 키로 두고, 옵션에서 별도 파라미터 없이 fetchRecentMarkedFolders만 호출하도록 분리한 것이 명확합니다. 기존 LIST/ALL/ELEMENT와 네이밍·구조가 일관되어 유지보수에도 좋아 보입니다.

src/pages/home/index.tsx (1)

6-35: 홈 화면이 훅 기반 실데이터로 자연스럽게 전환되었습니다.

useRecentMarkedFolders/Notes/useScheduledLearningItems를 컴포넌트 상단에서 호출해 각각의 리스트에 바로 내려주는 구조가 단순하고 읽기 좋습니다. 목업 데이터 의존성도 제거되어 실제 API와 동작이 잘 맞을 것 같습니다.

추가로, 초기 로딩/빈 배열일 때 각 리스트 컴포넌트가 어떤 UI를 보여주는지만 한 번 확인해 두시면 사용자 경험 측면에서 더 안전할 것 같습니다.

Comment on lines +1 to +5
export interface FetchStudyCardsParams {
order?: string;
color?: string;
studyStatus?: number;
}

@coderabbitai coderabbitai Bot Dec 6, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Cardify API /cards/sort-filter endpoint parameters specification

💡 Result:

I couldn’t find documentation for a Cardify API endpoint named /cards/sort-filter. Which "Cardify" are you using (provide the base URL or a link)? I found several different Cardify sites (Cardify AI, Cardify Africa API, Cardify.cards) but no matching endpoint in their docs. Examples: app.cardify.co (API terms) and cardifyai.com. [1][2]

If you share the base API URL or a docs link, I’ll fetch the exact parameter spec. [1] https://app.cardify.co/api.php
[2] https://cardifyai.com/


🏁 Script executed:

# Search for backend API documentation, specs, or configuration in the codebase
find . -type f \( -name "*.md" -o -name "*.json" -o -name "*.yaml" -o -name "*.yml" -o -name "*api*" -o -name "*spec*" \) | head -30

Repository: UMC-CARDIFY/Client

Length of output: 556


🏁 Script executed:

# Look for usage of FetchStudyCardsParams in the codebase
rg "FetchStudyCardsParams" -A 5 -B 2

Repository: UMC-CARDIFY/Client

Length of output: 1809


🏁 Script executed:

# Search for any constants or enums related to order, color, or studyStatus
rg "(order|color|studyStatus)" --type ts --type js -B 2 -A 2 | head -100

Repository: UMC-CARDIFY/Client

Length of output: 4693


🏁 Script executed:

# Check the API constants definition
cat src/constants/api.ts

Repository: UMC-CARDIFY/Client

Length of output: 968


🏁 Script executed:

# Look for the color map to see what colors are valid
fd "color-map" -o "colors"

Repository: UMC-CARDIFY/Client

Length of output: 193


🏁 Script executed:

# Search for test files or usage examples of these parameters
fd "\.test\.|\.spec\.|__tests__" -e ts -e tsx | head -20

Repository: UMC-CARDIFY/Client

Length of output: 44


🏁 Script executed:

# Look for any documentation or comments about valid parameter values
rg "studyStatus|order.*color" --type ts --type md -B 3 -A 3 | head -80

Repository: UMC-CARDIFY/Client

Length of output: 8573


🏁 Script executed:

# Find color-map or colors definition file
find . -type f -name "*color*map*" -o -name "*colors*" | grep -E "\.(ts|js|json)$"

Repository: UMC-CARDIFY/Client

Length of output: 110


🏁 Script executed:

# Check README for API documentation
cat README.md | head -100

Repository: UMC-CARDIFY/Client

Length of output: 70


🏁 Script executed:

# Look for components that use FetchStudyCardsParams to see example values
rg "fetchStudyCards\|FetchStudyCardsParams" -B 5 -A 10 --type ts --type tsx

Repository: UMC-CARDIFY/Client

Length of output: 89


🏁 Script executed:

# Search for color constants or validation
rg "order.*=|color.*=|studyStatus" --type ts -B 2 -A 2 | grep -i "const\|enum\|type" | head -30

Repository: UMC-CARDIFY/Client

Length of output: 2995


🏁 Script executed:

# Read the color-map to see valid colors
cat src/styles/color-map.ts

Repository: UMC-CARDIFY/Client

Length of output: 288


🏁 Script executed:

# Read colors.ts to see color definitions
cat src/styles/colors.ts

Repository: UMC-CARDIFY/Client

Length of output: 2238


🏁 Script executed:

# Search for order value assignments to understand valid values
rg "order.*=" --type ts -B 2 -A 2 | head -60

Repository: UMC-CARDIFY/Client

Length of output: 789


🏁 Script executed:

# Search for studyStatus value patterns
rg "studyStatus" --type ts -B 2 -A 2 | head -80

Repository: UMC-CARDIFY/Client

Length of output: 781


🏁 Script executed:

# Find and examine the Sort component to see valid order values
find . -type f -name "*Sort*" -o -name "*sort*" | grep -E "\.(ts|jsx)$"

Repository: UMC-CARDIFY/Client

Length of output: 44


🏁 Script executed:

# Search for where Sort component is defined and what values it accepts
rg "Sort" --type ts -B 5 -A 15 | grep -A 15 "const Sort\|function Sort\|<Sort" | head -100

Repository: UMC-CARDIFY/Client

Length of output: 7825


🏁 Script executed:

# Check if there's any backend documentation or API spec file
find . -type f \( -name "*.md" -o -name "*.swagger*" -o -name "*.openapi*" \) -exec grep -l "cards\|sort-filter" {} \;

Repository: UMC-CARDIFY/Client

Length of output: 44


🏁 Script executed:

# Find the SortOrder type definition
rg "type SortOrder|interface SortOrder|enum SortOrder" --type ts -A 5

Repository: UMC-CARDIFY/Client

Length of output: 458


🏁 Script executed:

# Search for Sort component definition to see what values it accepts
rg "const Sort|function Sort|export.*Sort" --type ts -B 2 -A 20 | head -100

Repository: UMC-CARDIFY/Client

Length of output: 3266


🏁 Script executed:

# Check for any validation or constants related to sort/filter parameters
rg "edit-newest|card-most|card-less" --type ts -B 2 -A 2

Repository: UMC-CARDIFY/Client

Length of output: 4982


🏁 Script executed:

# Search for studyStatus-related constants or type definitions
rg "studyStatus" --type ts -B 5 -A 5

Repository: UMC-CARDIFY/Client

Length of output: 1452


🏁 Script executed:

# Check if there are any constants or enums for card study states
rg "study|card.*status|STUDY" --type ts | grep -i "const\|enum\|type" | head -30

Repository: UMC-CARDIFY/Client

Length of output: 229


🏁 Script executed:

# Look at how studyStatus is used in components
rg "completedCards\|studyStatus" --type ts -B 3 -A 3 | head -80

Repository: UMC-CARDIFY/Client

Length of output: 44


파라미터 타입을 더욱 구체적으로 정의해주세요.

order 파라미터는 기존 SortOrder 타입("asc" | "desc" | "edit-newest" | "edit-oldest")을 사용하고, color는 유효한 색상 값(blue, ocean, lavender, mint, sage, gray, orange, coral, rose, plum)의 union 타입으로 변경해주세요. 또한 studyStatus의 유효한 값 범위가 문서화되어 있지 않으므로 개발팀과 확인하여 주석으로 명시해주세요.

🤖 Prompt for AI Agents
In src/types/card/card-request.ts around lines 1 to 5, the FetchStudyCardsParams
interface uses overly broad primitive types; change order to the existing
SortOrder union ("asc" | "desc" | "edit-newest" | "edit-oldest") (import
SortOrder if it lives elsewhere), change color to a union of valid color strings
(blue | ocean | lavender | mint | sage | gray | orange | coral | rose | plum),
and add a concise comment above studyStatus documenting the validated/allowed
numeric range (confirm exact values with the dev team and then annotate the
field comment accordingly); update imports and/or exports as needed to reference
SortOrder.

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.

이거 한번 확인좀 부탁드려요 !! 백엔드에서 전달해주는거!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for API documentation, OpenAPI specs, or backend contracts
echo "=== Searching for API documentation files ==="
find . -type f \( -name "*.md" -o -name "swagger*" -o -name "openapi*" -o -name "*api-spec*" -o -name "*api-doc*" \) 2>/dev/null | head -20

echo -e "\n=== Searching for README files ==="
find . -name "README*" -type f 2>/dev/null

echo -e "\n=== Checking for API documentation directories ==="
find . -type d -name "*doc*" -o -name "*spec*" 2>/dev/null | grep -i api | head -10

echo -e "\n=== Searching for backend type definitions or contracts ==="
rg -t ts -t json "cards.*sort.*filter|GET_CARDS_SORT_FILTER" -B 2 -A 5 | head -50

Length of output: 666


🏁 Script executed:

#!/bin/bash
# Check if there's a docs folder or API specification
echo "=== Looking for docs folder ==="
ls -la docs/ 2>/dev/null || echo "No docs folder found"

echo -e "\n=== Checking for any .http or .rest files (API testing files) ==="
find . -type f \( -name "*.http" -o -name "*.rest" \) 2>/dev/null

echo -e "\n=== Searching for backend repository references or submodules ==="
cat .gitmodules 2>/dev/null || echo "No submodules"

echo -e "\n=== Checking package.json for any backend-related scripts or links ==="
jq -r '.repository, .scripts, .devDependencies, .dependencies' package.json 2>/dev/null | head -30

Length of output: 1238


🏁 Script executed:

#!/bin/bash
# Search for any comments or documentation about the /cards/sort-filter endpoint
echo "=== Searching for comments about cards endpoint parameters ==="
rg -t ts -t tsx "cards.*sort|sort.*filter|FetchStudyCardsParams" -B 5 -A 5 | head -100

echo -e "\n=== Looking for JSDoc or comments near the endpoint usage ==="
rg -t ts "@param|@returns|\/\*\*.*cards" -B 2 -A 8 | head -50

Length of output: 265


🏁 Script executed:

#!/bin/bash
# Check if there's any backend documentation in common locations
echo "=== Checking common documentation locations ==="
for file in API.md api.md BACKEND.md backend.md docs/API.md docs/api.md; do
    if [ -f "$file" ]; then
        echo "Found: $file"
        cat "$file"
    fi
done

echo -e "\n=== Searching content of any markdown files for API or endpoint info ==="
find . -name "*.md" -type f -exec grep -l "cards\|endpoint\|API" {} \; 2>/dev/null | head -10

Length of output: 121


🏁 Script executed:

#!/bin/bash
# Check actual usage of fetchStudyCards to see what values are being passed
echo "=== Checking actual usage of fetchStudyCards ==="
rg "fetchStudyCards|CARD_QUERY_OPTION.LIST" -B 3 -A 3

echo -e "\n=== Looking for any test files or examples ==="
find . -name "*.test.ts" -o -name "*.spec.ts" -o -name "*.test.tsx" -o -name "*.spec.tsx" 2>/dev/null

echo -e "\n=== Checking the use-home-data.ts for actual parameter usage ==="
cat src/pages/home/hooks/use-home-data.ts

Length of output: 3721


🏁 Script executed:

#!/bin/bash
# Check if there's a backend repository link in GitHub or any documentation
echo "=== Checking for backend repository references ==="
rg -i "backend|server|api.*repo" -g "*.md" -g "*.json" -g "*.txt"

echo -e "\n=== Looking for any Notion, Confluence, or external doc links ==="
rg -i "notion|confluence|docs\.google|swagger|postman" -g "*.md"

echo -e "\n=== Checking README content ==="
cat README.md

Length of output: 159


🏁 Script executed:

#!/bin/bash
# Search for backend or server repositories in the same organization
echo "=== Searching for backend repositories in UMC-CARDIFY organization ==="
gh repo list UMC-CARDIFY --limit 20 --json name,description,url

echo -e "\n=== Checking current repository information ==="
gh repo view --json name,url,description

Length of output: 495


@Sohyunnnn, 프론트엔드 레포지토리에서 백엔드 API 명세를 찾을 수 없었습니다. 하지만 같은 조직의 백엔드 레포지토리를 찾았습니다:

🔗 https://github.com/UMC-CARDIFY/Server

백엔드 팀에 다음 정보를 확인해주세요:

확인이 필요한 파라미터 정보

1. order 파라미터

  • 현재 사용 중인 값: "edit-newest" (use-home-data.ts에서)
  • 확인 필요: 전체 허용 값 목록 (예: "asc", "desc", "edit-newest", "edit-oldest" 등)

2. color 파라미터

  • 확인 필요: 허용되는 색상 값 목록
  • 프론트엔드에서 사용 중인 색상들: blue, ocean, lavender, mint, sage, gray, orange, coral, rose, plum

3. studyStatus 파라미터

  • 확인 필요:
    • 허용되는 숫자 범위 (예: 0-5)
    • 각 숫자가 의미하는 학습 상태

추천 방법

백엔드 팀에서 정보를 받으면:

  1. 백엔드 레포에서 Swagger/OpenAPI 문서 확인
  2. 또는 /cards/sort-filter 엔드포인트의 컨트롤러 코드 확인
  3. 정보를 받은 후 타입을 더 구체적으로 수정 (union 타입으로)

백엔드 팀 확인 후 알려주시면, 타입 정의를 더 구체적으로 개선하는 것을 도와드리겠습니다! 🐰

@Sohyunnnn Sohyunnnn left a comment

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.

수고하셨습니다 :)

Comment thread src/constants/api.ts
Comment on lines 9 to 10
PATCH_FOLDERS: (folderId: number) => `/folders/${folderId}`,
DELETE_FOLDER: (folderId: number) => `/folders/${folderId}`,

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.

이거 지금보니까 둘이 똑같은데 하나로 합치는 거는 어떤가요 ??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

하나로 통일하면 사용하는 곳에서 코드 읽기가 어려울 것 같아서, 저는 개인적으로 분리하는게 낫다고 생각합니다!
나중에 의논해보면 좋을 것 같아용

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.

컨벤션이 조금 다른 거 같기도 하고 ....

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.

나중에 한번 상의해보면 좋을 듯!!

Comment on lines +1 to +5
export interface FetchStudyCardsParams {
order?: string;
color?: string;
studyStatus?: number;
}

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.

이거 한번 확인좀 부탁드려요 !! 백엔드에서 전달해주는거!

Comment thread src/types/card/index.ts

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.

이것도 컨벤션.. 통일하면 좋을 거 같습니다! 얘기 나눠보기

folderId: number;
name: string;
color: string;
markState: "ACTIVE" | "INACTIVE";

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.

markState response 에서 계속 쓰이고 있어서 전역에 type을 추가해두는 건 어떤지.. 생각이 들어요!.. 전체적으로 ..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

저도 그 생각을 했었는데, markState가 API별로 타입이 달라서 전역 타입으로 올리기엔 애매한 것 같아요..
이게 또 노트 쪽에서는 boolean 값으로 와서........ 하나로 통합하기가 애매....한데

@hyesngy
hyesngy merged commit 74eac70 into develop Dec 6, 2025
6 of 7 checks passed
@hyesngy
hyesngy deleted the feat/#110 branch December 6, 2025 06:17

This branch was successfully deployed

1 active deployment
Preview — 3fe3bf4a Deployed Dec 6, 2025 by vercel[bot]
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.

[Feature]: 홈 API 연동

2 participants