- aggiunta campi Gas data + fix

This commit is contained in:
Surya Paolo
2023-12-28 23:48:03 +01:00
parent c001587702
commit 5afe9dd1e2
9 changed files with 26 additions and 21 deletions

View File

@@ -9,7 +9,7 @@ const tools = require('../tools/general');
const { City } = require('../models/city');
const Product = require('../models/product');
const ProductInfo = require('../models/productinfo');
const ProductInfo = require('../models/productInfo');
const CatProd = require('../models/catprod');
var { authenticate } = require('../middleware/authenticate');
@@ -104,7 +104,7 @@ router.post('/import', authenticate, async (req, res) => {
if (risrecInfo._id) {
// Record existed, so it was updated
let arrfieldchange = tools.differentObjects(productInfo, recnewInfo);
if (arrfieldchange.length > 0) {
if (arrfieldchange && arrfieldchange.length > 0) {
// updated++;
console.log('Changed: ', recnewInfo.name + ': ' + arrfieldchange);
}