- ver 1.2.47 :
- corretto errore di modifica scheda - aggiunto scraping (fase 1)
This commit is contained in:
@@ -56,6 +56,9 @@ const MyPageSchema = new Schema({
|
||||
only_residenti: {
|
||||
type: Boolean,
|
||||
},
|
||||
only_admin: {
|
||||
type: Boolean,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
},
|
||||
@@ -200,6 +203,7 @@ MyPageSchema.statics.findOnlyStruttRec = async function (idapp) {
|
||||
active: 1,
|
||||
onlyif_logged: 1,
|
||||
only_residenti: 1,
|
||||
only_admin: 1,
|
||||
inmenu: 1,
|
||||
submenu: 1,
|
||||
iconsize: 1,
|
||||
@@ -227,6 +231,7 @@ MyPageSchema.statics.findInternalPages = async function (idapp) {
|
||||
path: 1,
|
||||
onlyif_logged: 1,
|
||||
only_residenti: 1,
|
||||
only_admin: 1,
|
||||
}).lean();
|
||||
|
||||
return result;
|
||||
|
||||
@@ -29,6 +29,9 @@ const productSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
delete: {
|
||||
type: Boolean,
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
@@ -462,7 +465,10 @@ module.exports.findAllIdApp = async function (idapp, code, id, all) {
|
||||
}
|
||||
|
||||
if (idapp) {
|
||||
myfind = { idapp };
|
||||
myfind = {
|
||||
idapp,
|
||||
$or: [{ delete: { $exists: false } }, { delete: false }],
|
||||
};
|
||||
}
|
||||
|
||||
if (!all) {
|
||||
|
||||
@@ -16,6 +16,9 @@ const productInfoSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
delete: {
|
||||
type: Boolean,
|
||||
},
|
||||
department: {
|
||||
type: String, ref: 'Department'
|
||||
},
|
||||
@@ -206,7 +209,13 @@ module.exports.findAllIdApp = async function (idapp, code, id) {
|
||||
try {
|
||||
|
||||
if (idapp)
|
||||
myfind = { idapp };
|
||||
myfind = {
|
||||
idapp,
|
||||
$or: [
|
||||
{ delete: { $exists: false } },
|
||||
{ delete: false }
|
||||
]
|
||||
};
|
||||
|
||||
if (code) {
|
||||
myfind = { ...myfind, code }
|
||||
@@ -539,11 +548,17 @@ module.exports.removeProductInfoWithoutDateUpdatedFromGM = async function (idapp
|
||||
for (const productinfo of arrproductInfo) {
|
||||
// cerca nella tabella Product se esiste idProductInfo = _id e cancella tutti i record che hanno questa corrispondenza
|
||||
if (Product) {
|
||||
await Product.deleteMany({ idProductInfo: productinfo._id });
|
||||
await Product.updateMany(
|
||||
{ idProductInfo: productinfo._id },
|
||||
{ $set: { delete: true } }
|
||||
);
|
||||
}
|
||||
|
||||
// Ora rimuovi anche questo productInfo
|
||||
await ProductInfo.deleteOne({ _id: productinfo._id });
|
||||
await ProductInfo.updateOne(
|
||||
{ _id: productinfo._id },
|
||||
{ $set: { delete: true } }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user