From f6c3da1fc0ee70e9ef58ac18a125e5200c558478 Mon Sep 17 00:00:00 2001 From: claudio torres aviles Date: Wed, 6 Apr 2022 13:43:59 -0400 Subject: [PATCH] changes on storage when inserting new text data on commands and triggers - this time is okay --- lib/agent/utils/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/agent/utils/storage.js b/lib/agent/utils/storage.js index e79e57a23..64f56dfa8 100644 --- a/lib/agent/utils/storage.js +++ b/lib/agent/utils/storage.js @@ -21,7 +21,7 @@ var types = { keys: ['id', 'command', 'target', 'options', 'started_resp', 'started', 'stopped_resp', 'stopped'], values: (data) => { return `'${data.id}', '${data.command}', '${data.target}', '${JSON.stringify( - data.options).replaceAll("'","")}' , 0, 'NULL', 0, 'NULL'`; + data.options).replace(/'/g, "")}' , 0, 'NULL', 0, 'NULL'`; } }, geofences: { @@ -45,7 +45,7 @@ var types = { values: (data) => { return `'${data.id}', '${data.name}', '${data.persist}', '${data.synced_at}', '${ data.last_exec - }', '${JSON.stringify(data.automation_events).replaceAll("'","")}', '${JSON.stringify(data.automation_actions).replaceAll("'","")}'`; + }', '${JSON.stringify(data.automation_events).replace(/'/g, "")}', '${JSON.stringify(data.automation_actions).replace(/'/g, "")}'`; } }, keys: {