From 1ed257de62484b363223b0c0ee5f8a848dbbc5a0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 26 Jun 2019 20:24:20 -0700 Subject: [PATCH] fix: Race condition fetching collection after doc create --- app/models/Document.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/Document.js b/app/models/Document.js index 410c7fa8a..55c102960 100644 --- a/app/models/Document.js +++ b/app/models/Document.js @@ -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,