✌️
This commit is contained in:
parent
3d536ddb3f
commit
31f36fa618
64 changed files with 241 additions and 256 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
import it from 'cafy';
|
||||
import $ from 'cafy';
|
||||
import User from '../../models/user';
|
||||
import { validateUsername } from '../../models/user';
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ import { validateUsername } from '../../models/user';
|
|||
*/
|
||||
module.exports = async (params) => new Promise(async (res, rej) => {
|
||||
// Get 'username' parameter
|
||||
const [username, usernameError] = it(params.username).expect.string().required().trim().validate(validateUsername).get();
|
||||
const [username, usernameError] = $(params.username).string().pipe(validateUsername).$;
|
||||
if (usernameError) return rej('invalid username param');
|
||||
|
||||
// Get exist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue