From 74865848f521b04e38d5fcec4cbca4b042eef156 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 16 Mar 2025 05:35:23 +0000 Subject: [PATCH] Fix type error in AddTransactionButton The type of the 'type' property in the newExpense object was incorrect, causing a TypeScript error. Changed the type to be explicitly 'expense' to match the Transaction type definition. --- src/components/AddTransactionButton.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/AddTransactionButton.tsx b/src/components/AddTransactionButton.tsx index dc1ab8e..99aa94e 100644 --- a/src/components/AddTransactionButton.tsx +++ b/src/components/AddTransactionButton.tsx @@ -7,6 +7,7 @@ import { useBudget } from '@/contexts/BudgetContext'; import { supabase } from '@/lib/supabase'; import { isSyncEnabled } from '@/utils/syncUtils'; import ExpenseForm, { ExpenseFormValues } from './expenses/ExpenseForm'; +import { Transaction } from '@/components/TransactionCard'; const AddTransactionButton = () => { const [showExpenseDialog, setShowExpenseDialog] = useState(false); @@ -27,13 +28,13 @@ const AddTransactionButton = () => { const now = new Date(); const formattedDate = `오늘, ${now.getHours()}:${now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()} ${now.getHours() >= 12 ? 'PM' : 'AM'}`; - const newExpense = { + const newExpense: Transaction = { id: Date.now().toString(), title: data.title, amount: parseInt(numericAmount), date: formattedDate, category: data.category, - type: 'expense' + type: 'expense' // 명시적으로 'expense'로 설정 }; // BudgetContext를 통해 지출 추가