Fix date format after sync

The date and time format was incorrect after syncing data from the cloud. This commit addresses the issue.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 10:48:06 +00:00
parent 1d911153a7
commit f558a0149d
5 changed files with 55 additions and 13 deletions

View File

@@ -50,7 +50,8 @@ export const uploadTransactions = async (userId: string): Promise<void> => {
date: normalizedDate, // 정규화된 날짜 사용
category: t.category,
type: t.type,
transaction_id: t.id
transaction_id: t.id,
notes: t.notes || null
};
if (existingIds.has(t.id)) {
@@ -76,6 +77,8 @@ export const uploadTransactions = async (userId: string): Promise<void> => {
// 기존 트랜잭션 업데이트 (있는 경우)
if (updateTransactions.length > 0) {
console.log(`${updateTransactions.length}개의 기존 트랜잭션 업데이트`);
// 각 트랜잭션을 개별적으로 업데이트
for (const transaction of updateTransactions) {
const { error: updateError } = await supabase
.from('transactions')
@@ -84,7 +87,7 @@ export const uploadTransactions = async (userId: string): Promise<void> => {
.eq('user_id', userId);
if (updateError) {
console.error('트랜잭션 업데이트 실패:', updateError);
console.error('트랜잭션 업데이트 실패:', updateError, transaction);
// 실패해도 계속 진행
}
}