fix: JS error on server

This commit is contained in:
Tom Moor
2020-05-20 21:03:53 -07:00
parent 8ac5a574f3
commit 47ff6feaee

View File

@ -887,9 +887,9 @@ router.post('documents.move', auth(), async ctx => {
const user = ctx.state.user; const user = ctx.state.user;
const document = await Document.findByPk(id, { userId: user.id }); const document = await Document.findByPk(id, { userId: user.id });
const { collection } = document;
authorize(user, 'move', document); authorize(user, 'move', document);
const { collection } = document;
if (collection.type !== 'atlas' && parentDocumentId) { if (collection.type !== 'atlas' && parentDocumentId) {
throw new InvalidRequestError( throw new InvalidRequestError(
'Document cannot be nested in this collection type' 'Document cannot be nested in this collection type'