This commit is contained in:
oneao committed 2026-03-04 22:22:07 +08:00
1 parent 34240d2e16
commit bf350d8d35
21 files changed
+670 -304

No files matched your search

@@ -16,7 +16,6 @@ interface FinanceState {
createCategory: (category: FinanceCategory) => void
updateCategory: (category: FinanceCategory) => void
deleteCategory: (id: number) => void
updateCategorySortNumber: (data: FinanceCategory[], type: number) => void
isDuplicateCategory: (name: string, type: number, excludeId: number | null) => boolean
getDefaultGroupRow: (iconName: string) => number
getCategoryById: (id: number) => FinanceCategory | null
@@ -301,16 +300,6 @@ export const useFinanceStore = create<FinanceState>()(
const finalCategories = allCategories.filter(c => c.id !== id)
set({ categories: finalCategories })
},
updateCategorySortNumber: (data, type) => {
const allCategories = get().categories
const otherCategories = allCategories.filter(c => c.type !== type)
const updatedData = data.map((item, index) => ({
...item,
sort_number: index,
}))
set({ categories: [...otherCategories, ...updatedData] })
},
isDuplicateCategory: (name, type, excludeId) => {
const categories = get().categories || []
return categories.some(c =>