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

@@ -1,5 +1,6 @@
// @flow
import { action, set, computed } from 'mobx';
import pkg from 'rich-markdown-editor/package.json';
import addDays from 'date-fns/add_days';
import invariant from 'invariant';
import { client } from 'utils/ApiClient';
@@ -180,6 +181,7 @@ export default class Document extends BaseModel {
try {
if (isCreating) {
return await this.store.create({
editorVersion: pkg.version,
parentDocumentId: this.parentDocumentId,
collectionId: this.collectionId,
title: this.title,
@@ -193,6 +195,7 @@ export default class Document extends BaseModel {
title: this.title,
text: this.text,
lastRevision: this.revision,
editorVersion: pkg.version,
...options,
});
} finally {