JacobPernell / songbird

Web-based MIDI piano roll editor for quick music sketches
1 stars 1 forks source link

[47]: add generic validation handler; add username validation #99

Closed mi4l closed 5 years ago

mi4l commented 5 years ago

Issue

Adds a generic validation handler for all of our server side validation needs. A field value is passed in first, followed by any functions needed to validation that field. The validation function returns any errors, which are then parsed by an error handler if they exist.

This PR also has all of the username validation handlers.

gatherValidationErrors(
    body.username,
    usernameCharactersValidator,
    usernameLengthValidator,
    usernameTypeValidator
);

/review @JacobPernell @mskalandunas