done adding new product

This commit is contained in:
Kfir Dayan 2023-06-09 19:04:46 +03:00
parent 2baa649390
commit 2a4acd1277

View file

@ -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' });
}