Product create - Test I was able to create a category, however when creating a product i tested it out using postman and got error: \"\", then i added the code which requires al
if (
!name ||
!description ||
!price ||
!category ||
!quantity ||
!shipping
) {
return res.status(400).json({
error: "All fields are required"
});
}
you are sending shipping false from postman , obviously it will return that 400 status, make it :
if (
!name ||
!description ||
!price ||
!category ||
!quantity ||
shipping!== true || shipping !==false //something like that(or use something from formidable)
) {
return res.status(400).json({
error: "All fields are required"
});
}
```