From ef91b7f53e0d83d560541a48727dce261af7a002 Mon Sep 17 00:00:00 2001 From: Paolo Torricelli Date: Wed, 26 Aug 2026 11:13:14 +0200 Subject: [PATCH] filter based only on date and not datetime, all leads also readed --- src/fetchLeadsFromKeystone.js | 4 ++-- src/hubspotConnector.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fetchLeadsFromKeystone.js b/src/fetchLeadsFromKeystone.js index 8a08883..ddbd35e 100644 --- a/src/fetchLeadsFromKeystone.js +++ b/src/fetchLeadsFromKeystone.js @@ -12,8 +12,8 @@ async function getLeads(lastRunDate, currentDate, unsent, test) { 'Content-type': 'application/json' }, body: JSON.stringify({ - after: lastRunDate, - before: currentDate, + after: lastRunDate.substring(0, 10), + before: currentDate.substring(0, 10), unsent: unsent, // If this variable is set to 0, then it will show leads that have been marked as seen (old leads) test: test, // If this is removed or set to 0, then all leads that are returned would be marked as seen. This allows you to only fetch new leads }) diff --git a/src/hubspotConnector.js b/src/hubspotConnector.js index 66d664b..9a30cbe 100644 --- a/src/hubspotConnector.js +++ b/src/hubspotConnector.js @@ -148,9 +148,9 @@ async function runConnector() { } try { - console.log('Retrieving data from Keystone...'); + console.log('Retrieving data from Keystone...', lastRunDate, currentDate, isDryRun ); // getLeads(lastRunDate, currentDate, unsent, test) - const unsetValue = 1; + const unsetValue = 0; const testValue = isDryRun ? 1 : 0; const leads = await getLeads(lastRunDate, currentDate, unsetValue, testValue);