mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
code refactor
This commit is contained in:
@@ -68,6 +68,7 @@ import type { PartialRecord } from '@/core/base.ts';
|
||||
import type { LanguageOption } from '@/locales/index.ts';
|
||||
import { type LocalizedPresetCategory, CategoryType } from '@/core/category.ts';
|
||||
import { getObjectOwnFieldCount, categorizedArrayToPlainArray } from '@/lib/common.ts';
|
||||
import { localizedPresetCategoriesToTransactionCategoryCreateWithSubCategories } from '@/lib/category.ts';
|
||||
|
||||
const props = defineProps<{
|
||||
f7route: Router.Route;
|
||||
@@ -109,7 +110,8 @@ function save(): void {
|
||||
submitting.value = true;
|
||||
showLoading(() => submitting.value);
|
||||
|
||||
const submitCategories = categorizedArrayToPlainArray(allPresetCategories.value);
|
||||
const presetCategoriesArray = categorizedArrayToPlainArray(allPresetCategories.value);
|
||||
const submitCategories = localizedPresetCategoriesToTransactionCategoryCreateWithSubCategories(presetCategoriesArray);
|
||||
|
||||
transactionCategoriesStore.addCategories({
|
||||
categories: submitCategories
|
||||
|
||||
Reference in New Issue
Block a user