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) { export async function createUser(req: Request, res: Response) {
try { try {
const { firstName, lastName, email, password, address } = req.body; const { firstName, lastName, email, password, address } = req.body;
// validate the request body first
if (!(email && password && firstName && lastName && address)) { if (!(email && password && firstName && lastName && address)) {
return res.status(400).json({ error: 'All inputs are required' }); return res.status(400).json({ error: 'All inputs are required' });
} }