From bc1c57de850270b470d03fad41f6cbb07f733c58 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 21 Jun 2023 13:10:22 +0200 Subject: [PATCH] Duplicate property changes variableName by default --- .../creature/creatureProperties/methods/duplicateProperty.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js b/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js index 9bb40898..25044a7d 100644 --- a/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js @@ -42,6 +42,11 @@ const duplicateProperty = new ValidatedMethod({ let propertyId = randomSrc.id(); property._id = propertyId; + // Change the variableName so it isn't immediately overridden + if (property.variableName) { + property.variableName += 'Copy' + } + // Get all the descendants let nodes = CreatureProperties.find({ 'ancestors.id': _id,