Skip to content

Commit

Permalink
Merge pull request #138 from forge42dev/fix_for_get_form_data
Browse files Browse the repository at this point in the history
Fix for getValidatedFormData
  • Loading branch information
AlemTuzlak authored Dec 12, 2024
2 parents 7035cf8 + 7d87705 commit b3f23f9
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 346 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {

### validateFormData

validateFormData is a utility function that can be used to validate form data in your action. It takes two arguments: the request object and the resolver function. It returns an object with two properties: `errors` and `data`. If there are no errors, `errors` will be `undefined`. If there are errors, `errors` will be an object with the same shape as the `errors` object returned by `useRemixForm`. If there are no errors, `data` will be an object with the same shape as the `data` object returned by `useRemixForm`.
validateFormData is a utility function that can be used to validate form data in your action. It takes two arguments: the formData object and the resolver function. It returns an object with two properties: `errors` and `data`. If there are no errors, `errors` will be `undefined`. If there are errors, `errors` will be an object with the same shape as the `errors` object returned by `useRemixForm`. If there are no errors, `data` will be an object with the same shape as the `data` object returned by `useRemixForm`.

The difference between `validateFormData` and `getValidatedFormData` is that `validateFormData` only validates the data while the `getValidatedFormData` function also extracts the data automatically from the request object assuming you were using the default setup.

Expand Down
Loading

0 comments on commit b3f23f9

Please sign in to comment.