Skip to content

Commit

Permalink
fix(validation): issue subpaths format
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEdoRan committed Aug 11, 2024
1 parent ab174ad commit 04f8af9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next-safe-action/src/adapters/typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TypeboxAdapter implements ValidationAdapter {
success: false,
issues: [...result.Errors(data)].map(({ message, path }) => ({
message,
path: [path],
path: path.split("/").slice(1),
})),
} as const;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next-safe-action/src/adapters/yup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class YupAdapter implements ValidationAdapter {
issues: [
{
message,
path: path && path.length > 0 ? [path] : undefined,
path: path && path.length > 0 ? path.split(".") : undefined,
},
] as ValidationIssue[],
} as const;
Expand Down

0 comments on commit 04f8af9

Please sign in to comment.