Check for parent document existance (#567)

This commit is contained in:
Jori Lallo
2018-02-04 23:43:43 -08:00
committed by GitHub
parent ff286b2eb5
commit b93ccf5fcc
3 changed files with 28 additions and 0 deletions

View File

@ -218,6 +218,8 @@ router.post('documents.create', auth(), async ctx => {
atlasId: ownerCollection.id,
},
});
if (!parentDocumentObj)
throw httpErrors.BadRequest('Invalid parentDocument');
}
const newDocument = await Document.create({