Format dates for synchronization
Use ISO format for data synchronization and user-friendly format for display.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user