Added deletion of documents

This commit is contained in:
Jori Lallo
2017-06-05 00:36:50 -07:00
parent a4dca58ae7
commit 1be0ff8105
3 changed files with 34 additions and 26 deletions

View File

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