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:
@@ -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);
|
||||
// 실패해도 계속 진행
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user