This PR adds a new API call to retrieve the total count of records from the SugarCRM REST API before running the export. It also adds logging functionality to log the module name, total record count, and starting offset in the specified format.
Summary of Changes
Modified the getModuleData function in getModuleData.ts to include a new axios.get call to the /rest/v10/<module>/count endpoint of the SugarCRM API to get the total count of records.
Added a console.log statement to log the module name, total record count, and starting offset in the format: "Pulling data from {module}. Total Records: {count}. Starting from offset {offset}".
Testing
Manually tested the changes by running the export and verifying that the module name, total record count, and starting offset are logged correctly.
Verified that the existing functionality of the getModuleData function is not affected by the changes.
Description
This PR adds a new API call to retrieve the total count of records from the SugarCRM REST API before running the export. It also adds logging functionality to log the module name, total record count, and starting offset in the specified format.
Summary of Changes
getModuleData
function ingetModuleData.ts
to include a newaxios.get
call to the/rest/v10/<module>/count
endpoint of the SugarCRM API to get the total count of records.console.log
statement to log the module name, total record count, and starting offset in the format: "Pulling data from {module}. Total Records: {count}. Starting from offset {offset}".Testing
getModuleData
function is not affected by the changes.Related Issue
Add a "count" API call
Fixes #6.
To checkout this PR branch, run the following command in your terminal:
To make tweaks to this pull request, leave a comment below or in the code.