From dea8b9f8baa12bdfdc93b857519611e0775540f1 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:22:13 +0000 Subject: [PATCH] Fix type errors in filtering Fixes type errors related to transaction filtering and property assignments. --- src/components/TransactionCard.tsx | 3 +++ src/hooks/transactions/filterOperations/types.ts | 1 + .../filterOperations/useMonthSelection.ts | 13 +++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/TransactionCard.tsx b/src/components/TransactionCard.tsx index a1ffc4a..81d8337 100644 --- a/src/components/TransactionCard.tsx +++ b/src/components/TransactionCard.tsx @@ -19,10 +19,12 @@ export type Transaction = { interface TransactionCardProps { transaction: Transaction; onUpdate?: (updatedTransaction: Transaction) => void; + onDelete?: (id: string) => void; // onDelete 속성 추가 } const TransactionCard: React.FC = ({ transaction, + onDelete, // onDelete prop 추가 }) => { const [isEditDialogOpen, setIsEditDialogOpen] = useState(false); const { title, amount, date, category } = transaction; @@ -47,6 +49,7 @@ const TransactionCard: React.FC = ({ transaction={transaction} open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen} + onDelete={onDelete} // onDelete prop 전달 /> ); diff --git a/src/hooks/transactions/filterOperations/types.ts b/src/hooks/transactions/filterOperations/types.ts index 40aafd7..da24388 100644 --- a/src/hooks/transactions/filterOperations/types.ts +++ b/src/hooks/transactions/filterOperations/types.ts @@ -13,4 +13,5 @@ export interface FilteringReturn { handlePrevMonth: () => void; handleNextMonth: () => void; getTotalExpenses: (filteredTransactions: Transaction[]) => number; + forceRefresh: () => void; } diff --git a/src/hooks/transactions/filterOperations/useMonthSelection.ts b/src/hooks/transactions/filterOperations/useMonthSelection.ts index f54effd..27a0731 100644 --- a/src/hooks/transactions/filterOperations/useMonthSelection.ts +++ b/src/hooks/transactions/filterOperations/useMonthSelection.ts @@ -1,14 +1,15 @@ -import { getPrevMonth, getNextMonth } from '../dateUtils'; - /** * 월 선택 관련 훅 * 이전/다음 월 선택 기능을 제공합니다. */ -export const useMonthSelection = ( - selectedMonth: string, - setSelectedMonth: (month: string) => void -) => { +export const useMonthSelection = ({ + selectedMonth, + setSelectedMonth +}: { + selectedMonth: string; + setSelectedMonth: (month: string) => void; +}) => { // 이전 월로 변경 const handlePrevMonth = () => { setSelectedMonth(getPrevMonth(selectedMonth));