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

Performing sequential and asynchronous custom validation #2528

Open
PerceptControl opened this issue Sep 8, 2024 · 0 comments
Open

Performing sequential and asynchronous custom validation #2528

PerceptControl opened this issue Sep 8, 2024 · 0 comments
Labels
type: question Questions about the usage of the library.

Comments

@PerceptControl
Copy link

I stuck in situation where I need to do serial db queries on validation stage. For example:

{
   Validate(aExistInDb)
   fieldA: string
   
   Validate(bExistInDb)
   fieldB: string
}

Let's assume validators "aExistInDb" and "bExistInDb" both are async and execute some select queries from db

In my situation field b relates on a. It means that I want to check fieldB only when I sure that "a" field exist and correct.
I expected that "bExistInDb" validation will run only when "aExistInDb" ends. But now both starts immediately.

What shall I do then?

@PerceptControl PerceptControl added the type: question Questions about the usage of the library. label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Questions about the usage of the library.
Development

No branches or pull requests

1 participant