Format dates for synchronization

Use ISO format for data synchronization and user-friendly format for display.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-17 23:47:05 +00:00
parent ce12e99f6d
commit 71aebf8b5b
5 changed files with 82 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import { Transaction } from '@/components/TransactionCard';
import { saveTransactionsToStorage } from '../../storageUtils';
import { deleteTransactionFromSupabase } from '../../supabaseUtils';
import { toast } from '@/hooks/useToast.wrapper';
import { normalizeDate } from '@/utils/sync/transaction/dateUtils';
/**
* 스토리지 및 Supabase 삭제 처리
@@ -31,6 +32,10 @@ export const handleDeleteStorage = (
// 동기적 에러를 피하기 위해 setTimeout으로 감싸기
setTimeout(() => {
try {
// ISO 형식으로 날짜 변환
const isoDate = normalizeDate(transactionToDelete.date);
console.log('삭제 중인 트랜잭션 ISO 날짜:', isoDate);
deleteTransactionFromSupabase(user, id)
.catch(error => {
console.error('Supabase 삭제 오류:', error);