fix: Race condition fetching collection after doc create

This commit is contained in:
Tom Moor 2019-06-26 20:24:20 -07:00
parent f0de382367
commit 1ed257de62
1 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ export default class Document extends BaseModel {
try {
if (isCreating) {
return this.store.create({
return await this.store.create({
parentDocumentId: this.parentDocumentId,
collectionId: this.collectionId,
title: this.title,
@ -169,7 +169,7 @@ export default class Document extends BaseModel {
});
}
return this.store.update({
return await this.store.update({
id: this.id,
title: this.title,
text: this.text,