Add payment method selection

Adds a payment method selection (Credit Card, Cash) to the expense form and includes a line separator. Also requests to add a graph showing the proportion of credit card and cash usage in expense analytics, but this part is not implemented in this commit.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 07:08:02 +00:00
parent 60ef765380
commit aa8381a823
12 changed files with 489 additions and 23 deletions

View File

@@ -1,3 +1,4 @@
import React, { useState, useEffect } from 'react';
import { PlusIcon } from 'lucide-react';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog';
@@ -53,7 +54,8 @@ const AddTransactionButton = () => {
amount: parseInt(numericAmount),
date: formattedDate,
category: data.category,
type: 'expense'
type: 'expense',
paymentMethod: data.paymentMethod // 추가된 필드
};
console.log('새 지출 추가:', newExpense);
@@ -75,7 +77,8 @@ const AddTransactionButton = () => {
date: isoDate, // ISO 형식 사용
category: data.category,
type: 'expense',
transaction_id: newExpense.id
transaction_id: newExpense.id,
payment_method: data.paymentMethod // Supabase에 필드 추가
});
if (error) throw error;