refactor: unify bank form types and actions

This commit is contained in:
2026-10-01 20:53:00 +03:00
parent 10baefda79
commit ff67a768ad
7 changed files with 98 additions and 47 deletions
@@ -5,6 +5,8 @@ import { validationMessage } from "@/shared/i18n";
import type { ExpenseCategory } from "../api/types";
const MAX_CATEGORY_NAME_LENGTH = 80;
type CategoryValues = z.infer<ReturnType<typeof categorySchema>>;
function categorySchema(categories?: ExpenseCategory[], editingId?: string) {
return z.object({
name: z
@@ -27,4 +29,4 @@ function categorySchema(categories?: ExpenseCategory[], editingId?: string) {
});
}
export { categorySchema };
export { categorySchema, type CategoryValues };