Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/forms/src/resolvers/zod/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { toValues } from '@primeuix/forms/utils';
import { isNotEmpty } from '@primeuix/utils';
import type { ParseParams, Schema } from 'zod';
import { z } from 'zod/v4';
Comment thread
meixger marked this conversation as resolved.
import type { ResolverOptions, ResolverResult } from '..';

export const zodResolver =
Expand All @@ -20,7 +21,7 @@ export const zodResolver =
return {
values: toValues(raw ? values : undefined, name),
errors: (e.issues || e.errors).reduce((acc: Record<string, any[]>, error: any) => {
const pathKey = isNotEmpty(error.path) ? error.path.join('.') : name;
const pathKey = isNotEmpty(error.path) ? z.core.toDotPath(error.path) : name;

if (pathKey) {
acc[pathKey] ||= [];
Expand Down