feat: Ensure that editorVersion is saved with document/revisions (#1212)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user