Fixed document.update API

This commit is contained in:
Jori Lallo
2017-06-28 23:18:46 -07:00
parent b6fa0a4a4e
commit 56beb8b55f
4 changed files with 86 additions and 39 deletions

View File

@@ -39,16 +39,13 @@ async function present(ctx, document, options) {
}
if (options.includeCollection) {
data.collection = await ctx.cache.get(document.atlasId, async () => {
const collection =
options.collection ||
(await Collection.findOne({
where: {
id: document.atlasId,
},
}));
return presentCollection(ctx, collection);
});
data.collection =
options.collection ||
(await Collection.findOne({
where: {
id: document.atlasId,
},
}));
}
if (options.includeCollaborators) {