diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index 9d3fa45..7d91158 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -7,7 +7,7 @@ import { clearJwtCookie, setJwtCookie } from '../middlewares/checkAuth'; export async function createUser(req: Request, res: Response) { try { const { firstName, lastName, email, password, address } = req.body; - // validate the request body first + if (!(email && password && firstName && lastName && address)) { return res.status(400).json({ error: 'All inputs are required' }); }