feat: Ensure that editorVersion is saved with document/revisions (#1212)

This commit is contained in:
Tom Moor
2020-03-16 08:30:23 -07:00
committed by GitHub
parent 4851f51d8b
commit f0be9beeb4
5 changed files with 29 additions and 0 deletions

View File

@@ -688,6 +688,7 @@ router.post('documents.create', auth(), async ctx => {
const {
title = '',
text = '',
editorVersion,
publish,
collectionId,
parentDocumentId,
@@ -726,6 +727,7 @@ router.post('documents.create', auth(), async ctx => {
let document = await Document.create({
parentDocumentId,
editorVersion,
collectionId: collection.id,
teamId: user.teamId,
userId: user.id,
@@ -781,6 +783,7 @@ router.post('documents.update', auth(), async ctx => {
publish,
autosave,
done,
editorVersion,
lastRevision,
append,
} = ctx.body;
@@ -798,6 +801,7 @@ router.post('documents.update', auth(), async ctx => {
// Update document
if (title) document.title = title;
if (editorVersion) document.editorVersion = editorVersion;
if (append) {
document.text += text;