From a5495e0fc9dfdf78ff944e9da8771b5141ab0a7c Mon Sep 17 00:00:00 2001 From: anilgupta Date: Wed, 30 Nov 2022 19:16:44 +0530 Subject: [PATCH] Issue #KN-439 fix: Fixed update scenario where response is return with metadata without reading it again. --- .../src/main/scala/org/sunbird/graph/GraphService.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ontology-engine/graph-core_2.11/src/main/scala/org/sunbird/graph/GraphService.scala b/ontology-engine/graph-core_2.11/src/main/scala/org/sunbird/graph/GraphService.scala index c931095f8..26afb68de 100644 --- a/ontology-engine/graph-core_2.11/src/main/scala/org/sunbird/graph/GraphService.scala +++ b/ontology-engine/graph-core_2.11/src/main/scala/org/sunbird/graph/GraphService.scala @@ -19,7 +19,7 @@ class GraphService { val metadata = CSPMetaUtil.updateRelativePath(node.getMetadata) node.setMetadata(metadata) } - NodeAsyncOperations.addNode(graphId, node) + NodeAsyncOperations.addNode(graphId, node).map(resNode => if(isrRelativePathEnabled) CSPMetaUtil.updateAbsolutePath(resNode) else resNode) } def upsertNode(graphId: String, node: Node, request: Request): Future[Node] = { @@ -27,11 +27,11 @@ class GraphService { val metadata = CSPMetaUtil.updateRelativePath(node.getMetadata) node.setMetadata(metadata) } - NodeAsyncOperations.upsertNode(graphId, node, request) + NodeAsyncOperations.upsertNode(graphId, node, request).map(resNode => if(isrRelativePathEnabled) CSPMetaUtil.updateAbsolutePath(resNode) else resNode) } def upsertRootNode(graphId: String, request: Request): Future[Node] = { - NodeAsyncOperations.upsertRootNode(graphId, request) + NodeAsyncOperations.upsertRootNode(graphId, request).map(resNode => if(isrRelativePathEnabled) CSPMetaUtil.updateAbsolutePath(resNode) else resNode) } def getNodeByUniqueId(graphId: String, nodeId: String, getTags: Boolean, request: Request): Future[Node] = {