question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Procedural validation?

See original GitHub issue

is there a way to prevent the next validation from firing if the one before fails?

Example I see that my axios request fires even though .email fails.

is this because Axios returns a promise and because of that I loose the ability to have procedural validation?

validationSchema: object().shape({
    email: string()
      .email('Invalid email address')
      .required('Email is required!')
      .test('email', 'this email is already taken', value => {
        return new Promise((resolve, _reject) => {
          Axios.get(make_url('/users/precheck?user[email]=' + value)).then(
            reponse => {
              resolve(reponse.data.precheck == 'ok');
            },
          );
        });
      }),
  }),

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jquensecommented, Jul 18, 2018

I’m open to adding something. I’m not sure what the API would look like tho. I’d take a PR tho for a good proposal

0reactions
joshchernoffcommented, Jul 18, 2018

To be honest it sounds like it would be a lot of rewriting stuff. If you think its a good idea (and I wholly support this) maybe a feature ticket would be in order to get more input from other users?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Perform Procedural Validation - TechDocs - Broadcom Inc.
Procedural validation provides the program with complete control over which data is validated, and the order in which the validation is ...
Read more >
Procedure for Method Validation (20180101)
This is the metrology laboratory policy and procedure for developing and validating test or calibration methods when no international or national procedures are ......
Read more >
Method Validation Procedure
Method validation seeks to quantify the likely accuracy of results. Page 5. STANDARD OPERATING PROCEDURE. Q-Pulse Reference: Method Validation Procedure.doc.
Read more >
Process Validation Procedure - Medical Device Academy
Process validation is required whenever there is a process that affects product quality that cannot be 100% inspected or where inspection/testing of the...
Read more >
Process Validation: General Principles and Practices - FDA
A. General Considerations for Process Validation . ... documented, and approved in accordance with the established procedure appropriate for.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found