mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
migrate transaction category edit page to composition API and typescript
This commit is contained in:
@@ -127,6 +127,16 @@ export class TransactionCategory implements TransactionCategoryInfoResponse {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static findNameById(categories: TransactionCategory[], id: string): string | null {
|
||||
for (const category of categories) {
|
||||
if (category.id === id) {
|
||||
return category.name;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static createNewCategory(type?: CategoryType, parentId?: string): TransactionCategory {
|
||||
return new TransactionCategory('', '', parentId || '0', type || CategoryType.Income, DEFAULT_CATEGORY_ICON_ID, DEFAULT_CATEGORY_COLOR, '', 0, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user