in the model "name", "commodityID", "totalAmount" are required, but notice commodity ID and totalAmount is part of an inner object "productDetails", and now I am using express-validator to do server-side validation as like this
this validation works for "name" fields which make sense but it doesn't work for the "totalAmount" and "commodityID" which are fields of an inner object,
and it is the pics I took throw postman
may you guys show me the right way to solve this problem
Use Wildcard * for nested Objects Read Here
[
check('name', " ").not().isEmpty()
check('productDetails.commdityID', " ").not().isEmpty()
check('productDetails.totalAmount', " ").not().isEmpty()
]