From 127ed7d57dd3f9c643d6d87360a82253a4b45085 Mon Sep 17 00:00:00 2001 From: Nastia Piven Date: Sun, 6 Oct 2024 19:51:07 +0200 Subject: [PATCH] fix: remove unused vars --- client/src/components/MonthCard.tsx | 9 +++------ client/src/components/Task.tsx | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/client/src/components/MonthCard.tsx b/client/src/components/MonthCard.tsx index 2cbd7dc..70b4159 100644 --- a/client/src/components/MonthCard.tsx +++ b/client/src/components/MonthCard.tsx @@ -22,13 +22,12 @@ interface MonthCardProps { } export function MonthCard({ year, monthData }: MonthCardProps) { - const { userId, today } = useAppContext(); + const { today } = useAppContext(); const [monthTasks, setMonthTasks] = useState(monthData.tasks); const [monthEntryRatings, setMonthEntryRatings] = useState([]); const { data: entriesMonthData, isLoading: isEntriesLoading } = useEntries({ - userId, year, month: monthData.month, }); @@ -68,16 +67,14 @@ export function MonthCard({ year, monthData }: MonthCardProps) { taskId: MongooseId, deletedTaskRatings: Status[], ) { - const updatedTasks = monthTasks.filter( - (task) => task._id !== taskId, - ); + const updatedTasks = monthTasks.filter((task) => task._id !== taskId); setMonthTasks(updatedTasks); setMonthEntryRatings((prev) => filterDeletedRatings(prev, deletedTaskRatings), ); - await deleteTask(userId, taskId); + await deleteTask(taskId); } const isCurrentMonth = today.month === monthData.month; diff --git a/client/src/components/Task.tsx b/client/src/components/Task.tsx index ef90804..bb0be2a 100644 --- a/client/src/components/Task.tsx +++ b/client/src/components/Task.tsx @@ -21,7 +21,7 @@ interface TaskProps { // Task export function Task({ task, year, month, onDelete }: TaskProps) { - const { userId, today } = useAppContext(); + const { today } = useAppContext(); const [newTaskTitle, setNewTaskTitle] = useState(task.title); const [editMode, setEditMode] = useState(false); @@ -30,7 +30,7 @@ export function Task({ task, year, month, onDelete }: TaskProps) { data: entriesData, isLoading, error, - } = useEntries({ userId, taskId: task._id, year, month }); + } = useEntries({ taskId: task._id, year, month }); const taskRatings = entriesData?.map((entry) => entry.status) || []; const isCurrentMonth = today.month === month && today.year === year;