Updated IDs and fixed tests

This commit is contained in:
Jori Lallo
2017-06-28 23:24:19 -07:00
parent 56beb8b55f
commit 22153441fa
5 changed files with 17 additions and 16 deletions

View File

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