Skip to content

Commit

Permalink
fix: Account create validator
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Sep 5, 2024
1 parent 76e200d commit fe23194
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/controllers/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ dotenv.config();

export class AccountController {
public static createValidator = [
check('username')
check('primaryEmail')
.exists()
.withMessage('username is required')
.isString()
.withMessage('username should be a unique valid string'),
.withMessage('primaryEmail is required')
.bail()
.isEmail()
.withMessage('Invalid email id')
.bail(),
check('name').optional().isString().withMessage('name should be a valid string'),
];
/**
* @openapi
Expand Down

0 comments on commit fe23194

Please sign in to comment.