File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/org/gridsuite/studyconfig/server/service Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,15 @@ public UUID createSpreadsheetConfigCollection(SpreadsheetConfigCollectionInfos d
162
162
@ Transactional
163
163
public UUID createSpreadsheetConfigCollectionFromConfigs (List <UUID > configUuids ) {
164
164
SpreadsheetConfigCollectionEntity entity = new SpreadsheetConfigCollectionEntity ();
165
+ Set <String > targetNames = new HashSet <>();
165
166
entity .setSpreadsheetConfigs (configUuids .stream ()
166
- .map (this ::duplicateSpreadsheetConfigEntity )
167
+ .map (configId -> {
168
+ SpreadsheetConfigEntity clone = duplicateSpreadsheetConfigEntity (configId );
169
+ String newName = getUniqueName (clone .getName (), targetNames , Set .of ());
170
+ clone .setName (newName );
171
+ targetNames .add (newName );
172
+ return clone ;
173
+ })
167
174
.toList ());
168
175
return spreadsheetConfigCollectionRepository .save (entity ).getId ();
169
176
}
You can’t perform that action at this time.
0 commit comments