From ea6658e1f5ec0f817b1a8eed7795ac1a9ec8dfb7 Mon Sep 17 00:00:00 2001 From: Choi Yong Won Date: Mon, 8 Sep 2025 00:36:52 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B2=B4=ED=81=AC=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=95=AD=EB=AA=A9=EC=97=90=20saveCount=20=EB=B0=8F?= =?UTF-8?q?=20isSaved=20=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EA=B8=B0=ED=83=80=20=EC=BD=94=EB=93=9C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/CheckList.tsx | 9 ++++++--- src/hook/useJobQuery.ts | 2 ++ src/pages/otherTodoList/OtherTodoListPage.tsx | 4 +++- src/pages/otherTodoList/components/OtherTodoCard.tsx | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/common/CheckList.tsx b/src/common/CheckList.tsx index 69c4bb1..fc72636 100644 --- a/src/common/CheckList.tsx +++ b/src/common/CheckList.tsx @@ -13,7 +13,7 @@ import Plus from '@assets/icons/plus.svg?react'; import BookMarkIcon from '@assets/icons/bookmark.svg?react'; import { useUpdateTodoMutation } from '@hook/todo/useUpdateTodoMutation.ts'; -type ChecklistItem = string | { id?: number; text: string }; +type ChecklistItem = string | { id?: number; text: string; saveCount?: number }; interface CheckListProps { lists: ChecklistItem[]; @@ -21,6 +21,7 @@ interface CheckListProps { className?: string; onChange?: (checkedIds: number[]) => void; showAddButton?: boolean; + saveCount?: number; } const CheckList = ({ @@ -34,7 +35,7 @@ const CheckList = ({ const isMyToPage = location.pathname.startsWith('/mytodo/list'); const { mutate: updateTodo } = useUpdateTodoMutation(); const normalized = lists.map((item) => - typeof item === 'string' ? { text: item } : item + typeof item === 'string' ? { text: item, saveCount: 0 } : item ); const [editIndex, setEditIndex] = useState(null); @@ -264,7 +265,9 @@ const CheckList = ({ <>
- 999 + + {item.saveCount ?? 0} +