Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Instruction

Next Steps: Expand Data Validation Requirements

Now that you've learned about some additional validation types let's expand the data validation requirements for creating new user accounts by requiring a password.

  1. In your POST /api/users route request handler, add an if statement that checks for a missing password value:

    router.post('/users', (req, res) => {
      ...
    
      // Validate that we have a `name`...