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
5 changes: 3 additions & 2 deletions src/common/CheckList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface CheckListProps {
className?: string;
onChange?: (checkedIds: number[]) => void;
showAddButton?: boolean;
saveCount?: number;
saveCount?: (number | undefined)[];
}

const CheckList = ({
Expand All @@ -30,6 +30,7 @@ const CheckList = ({
className = '',
onChange,
showAddButton,
saveCount,
}: CheckListProps) => {
const location = useLocation();
const isMyToPage = location.pathname.startsWith('/mytodo/list');
Expand Down Expand Up @@ -266,7 +267,7 @@ const CheckList = ({
<div className="mr-3 flex items-center gap-1 text-gray-500">
<BookMarkIcon className="h-[18px] w-[18px]" />
<span className="text-sm font-B03-SB">
{item.saveCount ?? 0}
{saveCount?.[idx] ?? 0}
</span>
</div>
<button
Expand Down
6 changes: 5 additions & 1 deletion src/pages/myTodo/components/todo/Todo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ const Todo = () => {
}, [todoData]);

useEffect(() => {
console.log(todoData);
ReactTagManager.action({
event: 'my_todo_page',
category: 'ν•  일 λͺ©λ‘',
clickText: '[λ‚˜μ˜ 할일] νŽ˜μ΄μ§€ 클릭 μ‹œ (μ§„μž…)',
source_page: location.pathname,
});
}, []);
}, [location.pathname, todoData]);

const handleCheckChange = (newIds: number[]) => {
const added = newIds.filter((id) => !checkedIds.includes(id));
Expand Down Expand Up @@ -113,6 +114,9 @@ const Todo = () => {
onChange={handleCheckChange}
className="flex w-full flex-col items-center gap-8 py-4"
showAddButton={true}
saveCount={todoData?.todos.map((todo) =>
todo.saveCount == null ? undefined : todo.saveCount
)}
/>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/validation/mydream/todoSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export const TodoSchema = z.object({
todoId: z.number(),
title: z.string(),
completed: z.boolean(),
saveCount: z.number().nullable(),
isSaved: z.boolean().nullable(),
});

export const TodoDataSchema = z.object({
Expand Down