Execute SQL queries
Run the provided SQL queries to create tables.
This commit is contained in:
@@ -17,7 +17,10 @@ export const syncTransactionsWithSupabase = async (
|
||||
.select('*')
|
||||
.eq('user_id', user.id);
|
||||
|
||||
if (error) throw error;
|
||||
if (error) {
|
||||
console.error('Supabase 데이터 조회 오류:', error);
|
||||
return transactions;
|
||||
}
|
||||
|
||||
if (data && data.length > 0) {
|
||||
// Supabase 데이터 로컬 형식으로 변환
|
||||
@@ -59,7 +62,7 @@ export const updateTransactionInSupabase = async (
|
||||
if (!user || !isSyncEnabled()) return;
|
||||
|
||||
try {
|
||||
await supabase.from('transactions')
|
||||
const { error } = await supabase.from('transactions')
|
||||
.upsert({
|
||||
user_id: user.id,
|
||||
title: transaction.title,
|
||||
@@ -69,6 +72,10 @@ export const updateTransactionInSupabase = async (
|
||||
type: transaction.type,
|
||||
transaction_id: transaction.id
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('트랜잭션 업데이트 오류:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Supabase 업데이트 오류:', error);
|
||||
}
|
||||
@@ -82,9 +89,13 @@ export const deleteTransactionFromSupabase = async (
|
||||
if (!user || !isSyncEnabled()) return;
|
||||
|
||||
try {
|
||||
await supabase.from('transactions')
|
||||
const { error } = await supabase.from('transactions')
|
||||
.delete()
|
||||
.eq('transaction_id', transactionId);
|
||||
|
||||
if (error) {
|
||||
console.error('트랜잭션 삭제 오류:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Supabase 삭제 오류:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user