All files / ragchat-api/routes users.js

100% Statements 24/24
100% Branches 0/0
100% Functions 0/0
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
import { Router } from "express";
import { createUser } from '../controllers/User.js';
import { sendVerificationEmail } from '../controllers/Auth.js';
import { createUserSchema } from "../validationSchemes/User.js";
import { validate } from "../utils/handleValidations.js";
 
 
const router = Router();
 
/**
 * CREATE ONE
 *
 * @param   {string}  name            real name of the user [required]
 * @param   {string}  username        nickname [required]
 * @param   {string}  email           email address [required | email]
 * @param   {string}  password        password [required | strong ]
 * @param   {string}  confirmPassword password confirmation [required | must match password]
 *
 * @return  {string}           sends a verification email & returns a related message
 */
router.post('/', validate(createUserSchema), createUser, sendVerificationEmail);
 
 
export default router;