From 9609a1ade36a5c3e428074ad4d5bd561a944cd62 Mon Sep 17 00:00:00 2001
From: diazjj <jjdiaz@cttc.es>
Date: Thu, 25 Jul 2024 17:14:35 +0200
Subject: [PATCH] Return Empty DataJson if record is not found

---
 src/dlt/gateway/dltApp/src/dltGateway.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dlt/gateway/dltApp/src/dltGateway.js b/src/dlt/gateway/dltApp/src/dltGateway.js
index 80eeebc17..c2cfb5e45 100644
--- a/src/dlt/gateway/dltApp/src/dltGateway.js
+++ b/src/dlt/gateway/dltApp/src/dltGateway.js
@@ -104,7 +104,7 @@ async function getFromDlt(call, callback) {
   } catch (error) {   
    if (error.message.includes("data not found for key")) {
     // Return an empty response when no record is found
-    callback(null, { record_id: call.request, data_json: "{}" });
+    callback(null, { record_id: call.request, data_json: "" });
   } else {
     // Send failure response with error message
     callback({
-- 
GitLab