From 8f7d66a60ba7fd096f06b96e65a6e34b6998200b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 13 Aug 2023 16:42:13 +0300 Subject: [PATCH] Documents --- lib/redux/document/document_middleware.dart | 6 +++++- lib/ui/app/presenters/entity_presenter.dart | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/redux/document/document_middleware.dart b/lib/redux/document/document_middleware.dart index 3affdd5b8..3d1a7a838 100644 --- a/lib/redux/document/document_middleware.dart +++ b/lib/redux/document/document_middleware.dart @@ -107,10 +107,14 @@ Middleware _saveDocument(DocumentRepository repository) { repository .saveData(store.state.credentials, action.document) .then((DocumentEntity document) { + document = document.rebuild((b) => b + ..parentId = action.document.parentId + ..parentType = action.document.parentType); + store.dispatch(SaveDocumentSuccess(document)); if (action.completer != null) { - action.completer.complete(null); + action.completer.complete(document); } }).catchError((Object error) { print(error); diff --git a/lib/ui/app/presenters/entity_presenter.dart b/lib/ui/app/presenters/entity_presenter.dart index 9defcb671..dc8dc8a10 100644 --- a/lib/ui/app/presenters/entity_presenter.dart +++ b/lib/ui/app/presenters/entity_presenter.dart @@ -40,6 +40,7 @@ class EntityPresenter { EntityType.user, EntityType.product, EntityType.transaction, + EntityType.document, ].contains(entity.entityType) || isNarrow) { return name;