- ver 1.1.15

This commit is contained in:
Surya Paolo
2025-01-09 17:14:31 +01:00
parent 836f7f572b
commit fa075683ae
7 changed files with 23 additions and 32 deletions

View File

@@ -842,11 +842,16 @@ module.exports = {
return JSON.parse(JSON.stringify(src));
},
CloneRecordToNew(src) {
CloneRecordToNew(src, modelTable) {
const myrec = Object.assign({}, src);
delete myrec._doc['_id'];
myrec._id = new ObjectId();
if (modelTable === 'Circuit') {
myrec._doc.name = myrec._doc.name + ' copia';
myrec._doc.path = myrec._doc.path + '_copia';
}
return myrec._doc;
},