[Create] Return cloned object in context

...to allow copyService to be used in the context of a
Save As action, with an appropriate navigation change.
This commit is contained in:
Victor Woeltjen 2016-02-10 12:23:10 -08:00
parent c43929f1c6
commit b37b82133e

@ -101,9 +101,14 @@ define(
* Will add a list of clones to the specified parent's composition
*/
function addClonesToParent(self) {
self.parent.getCapability("composition").add(self.firstClone.getId());
return self.parent.getCapability("persistence").persist()
.then(function(){return self.firstClone;});
return self.parent.getCapability("composition")
.add(self.firstClone.getId())
.then(function (addedClone) {
return self.parent.getCapability("persistence").persist()
.then(function () {
return addedClone;
});
});
}
/**