Fix module import errors
Corrected import paths for '@/contexts/BudgetContext' in multiple components to resolve module not found errors.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { Transaction } from '@/contexts/budget/types';
|
||||
import { useBudget } from '@/contexts/BudgetContext';
|
||||
import { useBudget } from '@/contexts/budget/BudgetContext';
|
||||
|
||||
export const useTransactionsOperations = (transactions: Transaction[]) => {
|
||||
const { updateTransaction: budgetUpdateTransaction, deleteTransaction: budgetDeleteTransaction } = useBudget();
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { Transaction } from '@/contexts/budget/types';
|
||||
import { useBudget } from '@/contexts/BudgetContext';
|
||||
import { useBudget } from '@/contexts/budget/BudgetContext';
|
||||
|
||||
export const useTransactionsOperations = (transactions: Transaction[]) => {
|
||||
const { deleteTransaction: budgetDeleteTransaction } = useBudget();
|
||||
const { updateTransaction: budgetUpdateTransaction, deleteTransaction: budgetDeleteTransaction } = useBudget();
|
||||
|
||||
// 트랜잭션 업데이트 함수
|
||||
const updateTransaction = useCallback((updatedTransaction: Transaction): void => {
|
||||
try {
|
||||
budgetUpdateTransaction(updatedTransaction);
|
||||
} catch (error) {
|
||||
console.error('트랜잭션 업데이트 중 오류:', error);
|
||||
}
|
||||
}, [budgetUpdateTransaction]);
|
||||
|
||||
// 트랜잭션 삭제 함수
|
||||
const deleteTransaction = useCallback(async (id: string): Promise<boolean> => {
|
||||
try {
|
||||
budgetDeleteTransaction(id);
|
||||
@@ -17,6 +26,7 @@ export const useTransactionsOperations = (transactions: Transaction[]) => {
|
||||
}, [budgetDeleteTransaction]);
|
||||
|
||||
return {
|
||||
updateTransaction,
|
||||
deleteTransaction
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user