done adding new product
This commit is contained in:
parent
2baa649390
commit
2a4acd1277
1 changed files with 1 additions and 1 deletions
|
@ -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' });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue