code refactor

This commit is contained in:
MaysWind
2025-01-16 23:16:20 +08:00
parent 4f21762533
commit 6878d5260d
4 changed files with 25 additions and 30 deletions
-11
View File
@@ -2,17 +2,6 @@ import { CategoryType } from '@/core/category.ts';
import { TransactionType } from '@/core/transaction.ts';
import { type TransactionCategoriesWithVisibleCount, TransactionCategory } from '@/models/transaction_category.ts';
export function setCategoryModelByAnotherCategory(category: TransactionCategory, category2: TransactionCategory): void {
category.id = category2.id;
category.type = category2.type;
category.parentId = category2.parentId;
category.name = category2.name;
category.icon = category2.icon;
category.color = category2.color;
category.comment = category2.comment;
category.visible = !category2.hidden;
}
export function transactionTypeToCategoryType(transactionType: TransactionType): CategoryType | null {
if (transactionType === TransactionType.Income) {
return CategoryType.Income;