Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Form): handle multiple paths in validate #1273

Merged
merged 3 commits into from
Jan 27, 2024

Conversation

AnthonySendra
Copy link
Contributor

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The primary motivation behind this change is to address a specific use case where multiple dynamic paths need validation for a multi-step form. In the original implementation, when a user progressed to the next step by clicking "continue," I needed to validate various steps asynchronously. The solution involved using await Promise.all(paths.map(path => form.value.validate(path))).

However, due to the asynchronous nature of the validate function, there was a potential issue where the final state of errors.value might not accurately reflect the expected validation results.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Jan 23, 2024 11:14am

@benjamincanac benjamincanac changed the title feat(Form) add support multiple paths for validate api function feat(Form): add support multiple paths for validate api function Jan 23, 2024
Copy link
Collaborator

@romhml romhml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

@benjamincanac benjamincanac changed the title feat(Form): add support multiple paths for validate api function feat(Form): support multiple paths in validate API function Jan 27, 2024
@benjamincanac benjamincanac changed the title feat(Form): support multiple paths in validate API function feat(Form): handle multiple paths in validate Jan 27, 2024
@benjamincanac benjamincanac merged commit 20ac4b3 into nuxt:dev Jan 27, 2024
2 checks passed
@benjamincanac
Copy link
Member

Thanks 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants