diff --git a/src/fetchLeads.js b/src/fetchLeadsFromKeystone.js similarity index 93% rename from src/fetchLeads.js rename to src/fetchLeadsFromKeystone.js index 0d8d235..9ca4f8d 100644 --- a/src/fetchLeads.js +++ b/src/fetchLeadsFromKeystone.js @@ -1,6 +1,5 @@ const path = require('path'); const fs = require('fs'); -const FILE_PATH = path.resolve(__dirname, './last-modified-date.json'); require('dotenv').config({ path: path.resolve(__dirname, '../.env') }); @@ -42,7 +41,7 @@ async function getLeads(lastRunDate, currentDate, unsent, test) { return result.data; } catch (error) { - console.log("Error fetching the data: ", error); + console.error("Error fetching the data: ", JSON.stringify(error.response?.data, null, 2) || error.message); return []; } } diff --git a/src/hublib.js b/src/hublib.js index c4ed2b6..0609f09 100644 --- a/src/hublib.js +++ b/src/hublib.js @@ -26,7 +26,7 @@ app.get('/install', async (req, res) => { app.get('/renew', async (req, res) => { const refreshTokenProof = { - grant_type: 'refresh_token', + grant_type: 'refresh_token', client_id: auth.hClientId, client_secret: auth.hClientSecret, redirect_uri: auth.hCallback,