@omer-x/next-form-actions 1.0.0-alpha.3 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -76,7 +76,7 @@ function defineFormAction(definition) {
|
|
|
76
76
|
if (definition.middlewares) await Promise.all(definition.middlewares.map((middleware) => middleware()));
|
|
77
77
|
const formData = allParams[allParams.length - 1];
|
|
78
78
|
const customArgs = allParams.slice(0, allParams.length - 2);
|
|
79
|
-
const validation = solveKnownIssues(definition.schema
|
|
79
|
+
const validation = solveKnownIssues(definition.schema, Object.fromEntries(formData.entries()));
|
|
80
80
|
if (!validation.success) return bundleErrors(validation.error.issues);
|
|
81
81
|
try {
|
|
82
82
|
return await definition.action(validation.data)(...customArgs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omer-x/next-form-actions",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "Provides helper functions to define a type-safe React server action for forms, validating form data with Zod and handling errors internally.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|