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) {
|
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' });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue