chore: Missing runInAction in DocumentsStore
This commit is contained in:
@@ -724,15 +724,17 @@ export default class DocumentsStore extends Store<Document> {
|
|||||||
...params,
|
...params,
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
|
|
||||||
invariant(res?.data, "Data should be available");
|
invariant(res?.data, "Data should be available");
|
||||||
|
|
||||||
const collection = this.getCollectionForDocument(res.data);
|
const collection = this.getCollectionForDocument(res.data);
|
||||||
await collection?.fetchDocuments({ force: true });
|
await collection?.fetchDocuments({ force: true });
|
||||||
|
|
||||||
|
return runInAction("Document#update", () => {
|
||||||
const document = this.add(res.data);
|
const document = this.add(res.data);
|
||||||
this.addPolicies(res.policies);
|
this.addPolicies(res.policies);
|
||||||
|
|
||||||
return document;
|
return document;
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
this.isSaving = false;
|
this.isSaving = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user