controller/ProductCtrl.js
Consider simplifying this complex logical expression. Open
Open
if (!IS_NAME_CHECKED || !IS_DESC_CHECKED || !IS_ALT_CHECKED || !IS_PRICE_CHECKED || !ID_CAT_CHECKED) {
return res.status(403).json({
message: CHECK_NAME || CHECK_TEXT || CHECK_NAME || CHECK_PRICE || CHECK_CAT
});
}
Function updateProduct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.updateProduct = async (req, res, next) => {
const { PRODUCT_NOT_UPDATED, PRODUCT_UPDATED } = process.env;
const ID = parseInt(req.params.id, 10);
form.parse(req, async (err, fields, files) => {