This commit is contained in:
Tom Moor
2020-06-02 23:17:54 -07:00
parent 33815639f2
commit 4b4f4fd188

View File

@@ -186,13 +186,17 @@ export default class Document extends BaseModel {
});
}
return await this.store.update({
id: this.id,
title: this.title,
text: this.text,
lastRevision: options.lastRevision,
...options,
});
if (options.lastRevision) {
return await this.store.update({
id: this.id,
title: this.title,
text: this.text,
lastRevision: options.lastRevision,
...options,
});
}
throw new Error('Attempting to update without a lastRevision');
} finally {
this.isSaving = false;
}