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.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 05:35:23 +00:00
parent 0824b812cb
commit 74865848f5

View File

@@ -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를 통해 지출 추가