[Composition] Return newly-contextualized object

After adding to composition, return the newly-contextualized
object; this is regularly used by other services.
This commit is contained in:
Victor Woeltjen
2015-09-02 11:37:47 -07:00
parent ba6e542d08
commit b1238b0c96
3 changed files with 26 additions and 19 deletions

View File

@@ -97,17 +97,7 @@ define(
}
return parentPersistence.persist().then(function () {
// Locate and return new Object in context of parent.
return parent
.useCapability('composition')
.then(function (children) {
var i;
for (i = 0; i < children.length; i += 1) {
if (children[i].getId() === id) {
return children[i];
}
}
});
return result;
});
});
}