Created
May 11, 2020 21:46
-
-
Save sygn/2b13d95d845b9e4ec2239a87c90d73e3 to your computer and use it in GitHub Desktop.
async form validation
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
// email validation | |
// .test('checkDuplUsername', 'same name exists', function (value) { | |
// return new Promise((resolve, reject) => { | |
// kn.http({ | |
// url: `/v1/api/${value}`, | |
// method: 'head', | |
// }).then(() => { | |
// // exists | |
// resolve(false) | |
// }).catch(() => { | |
// // note exists | |
// resolve(true) | |
// }) | |
// }) | |
// }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment