- creato editor di Pagine (iniziato)
- fix: mancano i "t," su alcuni componenti...
This commit is contained in:
@@ -1126,23 +1126,6 @@ async function eseguiDbOpUser(idapp, mydata, locale, req, res) {
|
||||
await User.findOneAndUpdate({ _id: mydata._id }, { $set: { 'profile.noCircIta': mydata.value } });
|
||||
} else if (mydata.dbop === 'noFoto') {
|
||||
await User.findOneAndUpdate({ _id: mydata._id }, { $set: { 'profile.noFoto': mydata.value } });
|
||||
} else if (mydata.dbop === 'convertProductInfos') {
|
||||
const products = await Product.find({ idProductInfo: { $exists: true } });
|
||||
for (const product of products) {
|
||||
const productInfo = await ProductInfo.findById(product.idProductInfo);
|
||||
if (productInfo) {
|
||||
const productInfoObj = productInfo.toObject();
|
||||
delete productInfoObj._id;
|
||||
delete productInfoObj.__v;
|
||||
await Product.updateOne(
|
||||
{ _id: product._id },
|
||||
{
|
||||
$set: { productInfo: productInfoObj },
|
||||
$unset: { idProductInfo: 1 },
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.message);
|
||||
|
||||
Reference in New Issue
Block a user