Check for parent document existance (#567)
This commit is contained in:
@ -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({
|
||||
|
Reference in New Issue
Block a user