Created
April 19, 2015 01:11
-
-
Save Jacoby6000/ed0f57709c262694829c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(data: T)(onSuccess: T => Either[BadRequest, T]): Either[BadRequest, T] = | |
validateCreateData(data) match { | |
case Right(sanitizedData) => onSuccess(sanitizedData) | |
case fail: Left => fail | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment