Refactor project for improvements
This commit refactors the project to improve overall code quality, performance, and maintainability. Specific changes may include code cleanup, optimization, and architectural enhancements.
This commit is contained in:
@@ -13,12 +13,14 @@ const TransactionDateGroup: React.FC<TransactionDateGroupProps> = ({
|
||||
transactions,
|
||||
onTransactionDelete
|
||||
}) => {
|
||||
// onTransactionDelete 함수를 래핑하여 Promise<boolean>을 반환하도록 보장
|
||||
// 안정적인 삭제 핸들러
|
||||
const handleDelete = async (id: string): Promise<boolean> => {
|
||||
try {
|
||||
return await onTransactionDelete(id);
|
||||
// 적절한 타입 변환 처리
|
||||
const result = await Promise.resolve(onTransactionDelete(id));
|
||||
return !!result;
|
||||
} catch (error) {
|
||||
console.error('트랜잭션 삭제 처리 중 오류:', error);
|
||||
console.error('삭제 처리 중 오류:', error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user