Update docs

Remove extra API request after document.update
Cleanup
This commit is contained in:
Tom Moor
2018-05-07 22:08:47 -07:00
parent 67f2b3cce4
commit ba0a7b7f4a
7 changed files with 56 additions and 20 deletions

View File

@@ -11,7 +11,7 @@ import type { User } from 'types';
import BaseModel from './BaseModel';
import Collection from './Collection';
type SaveOptions = { publish: boolean, done: boolean, autosave: boolean };
type SaveOptions = { publish?: boolean, done?: boolean, autosave?: boolean };
class Document extends BaseModel {
isSaving: boolean = false;
@@ -204,9 +204,9 @@ class Document extends BaseModel {
this.hasPendingChanges = false;
});
this.emit('collections.update', {
id: this.collection.id,
collection: this.collection,
this.emit('documents.update', {
document: this,
collectionId: this.collection.id,
});
} catch (e) {
this.errors.add('Document failed saving');