From 2a4acd127780eddcb6b9e7c1e3f177b521ccaf58 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Fri, 9 Jun 2023 19:04:46 +0300 Subject: [PATCH] done adding new product --- src/controllers/UserController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' }); }