refactor: unify bank form types and actions
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user