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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
16 changes: 16 additions & 0 deletions src/apis/card/card-queries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { queryOptions } from "@tanstack/react-query";
import { FetchStudyCardsParams } from "@typedefs";
import { fetchStudyCards } from "./card";

export const CARD_QUERY_KEY = {
ALL: () => ["cards"] as const,
LIST: (params?: FetchStudyCardsParams) => ["cards", "list", params] as const,
} as const;

export const CARD_QUERY_OPTION = {
LIST: (params?: FetchStudyCardsParams) =>
queryOptions({
queryKey: CARD_QUERY_KEY.LIST(params),
queryFn: () => fetchStudyCards(params),
}),
};
7 changes: 7 additions & 0 deletions src/apis/card/card.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { apiGet } from "@apis/common/methods";
import { END_POINTS } from "@constants/api";
import { FetchStudyCardsParams, StudyCardListResponse } from "@typedefs";

export const fetchStudyCards = (params?: FetchStudyCardsParams) => {
return apiGet<StudyCardListResponse, FetchStudyCardsParams>(END_POINTS.GET_CARDS_SORT_FILTER, params);
};
8 changes: 7 additions & 1 deletion src/apis/folder/folder-queries.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { queryOptions } from "@tanstack/react-query";
import { FetchFoldersParams } from "@typedefs";
import { fetchFolderList, getFoldersElement } from "./folder";
import { fetchFolderList, fetchRecentMarkedFolders, getFoldersElement } from "./folder";

export const FOLDER_QUERY_KEY = {
ALL: () => ["folders"] as const,
LIST: (params?: FetchFoldersParams) => ["folders", "list", params] as const,
ELEMENT: (folderId: number) => ["folders", "element", folderId] as const,
RECENT_MARKED: () => ["folders", "recent-marked"] as const,
} as const;

export const FOLDER_QUERY_OPTION = {
Expand All @@ -24,4 +25,9 @@ export const FOLDER_QUERY_OPTION = {
queryKey: FOLDER_QUERY_KEY.ELEMENT(folderId),
queryFn: () => getFoldersElement(folderId),
}),
RECENT_MARKED: () =>
queryOptions({
queryKey: FOLDER_QUERY_KEY.RECENT_MARKED(),
queryFn: () => fetchRecentMarkedFolders(),
}),
};
5 changes: 5 additions & 0 deletions src/apis/folder/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
FolderElementResponse,
FolderListResponse,
PatchFolderResponse,
RecentMarkedFoldersResponse,
ToggleFolderMarkResponse,
UpdateFolderRequest,
} from "@typedefs";
Expand Down Expand Up @@ -38,3 +39,7 @@ export const postSubFolder = (parentFolderId: number, body: { name: string }) =>
export const getFoldersElement = (folderId: number) => {
return apiGet<FolderElementResponse>(END_POINTS.GET_FOLDERS_ELEMENT(folderId));
};

export const fetchRecentMarkedFolders = () => {
return apiGet<RecentMarkedFoldersResponse>(END_POINTS.GET_RECENT_MARKED_FOLDERS);
};
8 changes: 7 additions & 1 deletion src/apis/note/note-queries.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { queryOptions } from "@tanstack/react-query";
import { FetchNoteListParams } from "@typedefs";
import { fetchNoteList } from "./note";
import { fetchNoteList, fetchRecentMarkedNotes } from "./note";

export const NOTE_QUERY_KEY = {
ALL: () => ["notes"] as const,
LIST: (params?: FetchNoteListParams) => ["notes", "list", params] as const,
DELETE: (noteId: number) => ["notes", "delete", noteId] as const,
RECENT_MARKED: () => ["notes", "recent-marked"] as const,
} as const;

export const NOTE_QUERY_OPTION = {
Expand All @@ -14,4 +15,9 @@ export const NOTE_QUERY_OPTION = {
queryKey: NOTE_QUERY_KEY.LIST(params),
queryFn: () => fetchNoteList(params),
}),
RECENT_MARKED: () =>
queryOptions({
queryKey: NOTE_QUERY_KEY.RECENT_MARKED(),
queryFn: () => fetchRecentMarkedNotes(),
}),
};
6 changes: 6 additions & 0 deletions src/apis/note/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
GetNoteRequest,
GetNoteResponse,
NoteListResponse,
RecentMarkedNotesResponse,
ToggleNoteMarkRequest,
ToggleNoteMarkResponse,
WriteNoteRequest,
Expand Down Expand Up @@ -56,3 +57,8 @@ export const addNote = (request: AddNoteRequest) => {
export const getNote = (params: GetNoteRequest) => {
return apiGet<GetNoteResponse, GetNoteRequest>(END_POINTS.GET_NOTE, params);
};

// 최근 즐겨찾기한 노트 목록 조회
export const fetchRecentMarkedNotes = () => {
return apiGet<RecentMarkedNotesResponse>(END_POINTS.GET_RECENT_MARKED_NOTES);
};
5 changes: 5 additions & 0 deletions src/constants/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const END_POINTS = {

//FOLDER
GET_SORT_FILTER: "/folders/sort-filter",
GET_RECENT_MARKED_FOLDERS: "/folders/recent-marks",
POST_FOLDERS: "/folders/addFolder",
PATCH_FOLDERS: (folderId: number) => `/folders/${folderId}`,
DELETE_FOLDER: (folderId: number) => `/folders/${folderId}`,
Comment on lines 9 to 10

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.

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

Expand All @@ -13,9 +14,13 @@ export const END_POINTS = {

//NOTE
GET_NOTES_SORT_FILTER: "/folders/notes/sort-filter",
GET_RECENT_MARKED_NOTES: "/notes/recent-marks",
GET_NOTE: "/notes/getNote",
MARK_NOTE: "/notes/markNote",
DELETE_NOTE: "/notes/deleteNote",
WRITE_NOTE: "/notes/write",
ADD_NOTE: "/notes/addNote",

//CARD
GET_CARDS_SORT_FILTER: "/cards/sort-filter",
};
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const MainFolderList: React.FC<MainFolderListProps> = ({
return (
<div className="w-[50rem]">
<div className="gap-4 flex flex-wrap">
{currentPage === 1 && <NewFolderMain onLimitReached={onLimitReached} />}
{!isHome && currentPage === 1 && <NewFolderMain onLimitReached={onLimitReached} />}

{displayedFolders.map((folder) => (
<MainFolderItem key={folder.folderId} {...folder} variant={variant} />
Expand Down
56 changes: 56 additions & 0 deletions src/pages/home/hooks/use-home-data.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.

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

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.

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { CARD_QUERY_OPTION } from "@apis/card/card-queries";
import { FOLDER_QUERY_OPTION } from "@apis/folder/folder-queries";
import { NOTE_QUERY_OPTION } from "@apis/note/note-queries";
import { MainFolderProps } from "@pages/archive/components/MainFolderList/MainFolderList";
import { useQuery } from "@tanstack/react-query";
import { NoteItemProps, RecentMarkedFolder, RecentMarkedNote, ScheduledLearningItemProps, StudyCard } from "@typedefs";

const mapToMainFolderProps = (folder: RecentMarkedFolder): MainFolderProps => ({
folderId: folder.folderId,
folderName: folder.name,
folderColor: folder.color,
noteCount: folder.noteCount,
markState: folder.markState === "ACTIVE",
createdAt: folder.markDate,
});

const mapToNoteItemProps = (note: RecentMarkedNote): NoteItemProps => ({
noteId: note.noteId,
name: note.name,
folderId: note.folderId,
folderName: note.folderName,
folderColor: note.folderColor,
flashCardCount: note.flashCardCount,
markState: note.markState,
viewAt: null,
editDate: note.markAt,
createdAt: note.markAt,
isDownload: false,
isUpload: false,
content: note.noteContentPreview ?? undefined,
});

const mapToScheduledLearningProps = (card: StudyCard): ScheduledLearningItemProps => ({
noteid: card.studyCardSetId,
name: card.noteName,
folderId: 0,
folderName: card.folderName,
folderColor: card.color,
completedCards: card.studyStatus,
timeReachedCards: 5,
});

export const useRecentMarkedFolders = () => {
const { data = [] } = useQuery(FOLDER_QUERY_OPTION.RECENT_MARKED());
return data.map(mapToMainFolderProps);
};

export const useRecentMarkedNotes = () => {
const { data = [] } = useQuery(NOTE_QUERY_OPTION.RECENT_MARKED());
return data.map(mapToNoteItemProps);
};

export const useScheduledLearningItems = () => {
const { data = [] } = useQuery(CARD_QUERY_OPTION.LIST({ order: "edit-newest" }));
return data.slice(0, 3).map(mapToScheduledLearningProps);
};
13 changes: 8 additions & 5 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { Text } from "@components/typography/Text";
import useAccessTokenFromUrl from "@hooks/use-access-token-from-url";
import { mockRecentMarkedNotes } from "@mocks/mock-recent-marked-notes";
import { mockScheduledLearningItems } from "@mocks/mock-scheduled-learning-items";
import MainFolderList from "@pages/archive/components/MainFolderList/MainFolderList";
import RecentMarkedNoteList from "./components/RecentMarkedNote/RecentMarkedNoteList";
import ScheduledLearningList from "./components/ScheduledLearning/ScheduledLearningList";
import { useRecentMarkedFolders, useRecentMarkedNotes, useScheduledLearningItems } from "./hooks/use-home-data";

const Home = () => {
useAccessTokenFromUrl();

const folders = useRecentMarkedFolders();
const notes = useRecentMarkedNotes();
const scheduledItems = useScheduledLearningItems();

return (
<div className="w-[50rem] mx-auto pb-20 text-base-black">
<Text variant="sub_heading1" className="mt-10">
Expand All @@ -18,17 +21,17 @@ const Home = () => {
<Text variant="sub_heading2" className="mt-10 mb-6 block">
지금 학습하기
</Text>
<ScheduledLearningList items={mockScheduledLearningItems} />
<ScheduledLearningList items={scheduledItems} />

<Text variant="sub_heading2" className="mt-14 mb-6 block">
최근 즐겨찾기 한 폴더
</Text>
<MainFolderList variant="home" maxItems={4} />
<MainFolderList folders={folders} variant="home" maxItems={4} />

<Text variant="sub_heading2" className="mt-12 mb-6 block">
최근 즐겨찾기 한 노트
</Text>
<RecentMarkedNoteList items={mockRecentMarkedNotes} />
<RecentMarkedNoteList items={notes} />
</div>
);
};
Expand Down
7 changes: 7 additions & 0 deletions src/types/card/card-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { SortOrder } from "../common";

export interface FetchStudyCardsParams {
order?: SortOrder;
color?: string;
studyStatus?: number;
}
Comment on lines +3 to +7

@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 타입으로)

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

12 changes: 12 additions & 0 deletions src/types/card/card-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export interface StudyCard {
studyStatus: number;
noteName: string;
color: string;
folderName: string;
recentStudyDate: string | null;
nextStudyDate: string | null;
studyCardSetId: number;
markStatus: "ACTIVE" | "INACTIVE";
}

export type StudyCardListResponse = StudyCard[];
2 changes: 2 additions & 0 deletions 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.

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./card-request";
export * from "./card-response";
1 change: 1 addition & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type SortOrder = "asc" | "desc" | "edit-newest" | "edit-oldest";
11 changes: 11 additions & 0 deletions src/types/folder/folder-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@ export interface NotMarkElementList {
folderList: FolderItem[];
noteList: NoteItem[];
}

export interface RecentMarkedFolder {
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 값으로 와서........ 하나로 통합하기가 애매....한데

markDate: string;
noteCount: number;
}

export type RecentMarkedFoldersResponse = RecentMarkedFolder[];
2 changes: 2 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from "./common";
export * from "./folder";
export * from "./note";
export * from "./home";
export * from "./card";
14 changes: 14 additions & 0 deletions src/types/note/note-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,17 @@ export interface GetNoteResponse {
isUpload: boolean;
cardList: CardItem[];
}

export interface RecentMarkedNote {
noteId: number;
name: string;
folderId: number;
folderName: string;
folderColor: string;
flashCardCount: number;
markState: "ACTIVE" | "INACTIVE";
markAt: string;
noteContentPreview: string | null;
}

export type RecentMarkedNotesResponse = RecentMarkedNote[];