feat(BambooHR Node): Add support for Only Current on company reports (#7878)

Github issue / Community forum post (link here to close automatically):
https://github.com/n8n-io/n8n/issues/7876

API Docs for reference:
https://documentation.bamboohr.com/reference/get-company-report-1
This commit is contained in:
Jon 2023-12-05 10:34:28 +00:00 committed by GitHub
parent 9604b87da9
commit 4175801c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -89,6 +89,13 @@ export const companyReportGetDescription: INodeProperties[] = [
default: true, default: true,
description: 'Whether to apply the standard duplicate field filtering or not', description: 'Whether to apply the standard duplicate field filtering or not',
}, },
{
displayName: 'Only Current',
name: 'onlyCurrent',
type: 'boolean',
default: true,
description: 'Whether to hide future dated values from the history table fields or not',
},
], ],
}, },
]; ];

View file

@ -11,9 +11,10 @@ export async function get(this: IExecuteFunctions, index: number) {
const reportId = this.getNodeParameter('reportId', index) as string; const reportId = this.getNodeParameter('reportId', index) as string;
const format = this.getNodeParameter('format', 0) as string; const format = this.getNodeParameter('format', 0) as string;
const fd = this.getNodeParameter('options.fd', index, true) as boolean; const fd = this.getNodeParameter('options.fd', index, true) as boolean;
const onlyCurrent = this.getNodeParameter('options.onlyCurrent', index, true) as boolean;
//endpoint //endpoint
const endpoint = `reports/${reportId}/?format=${format}&fd=${fd}`; const endpoint = `reports/${reportId}/?format=${format}&fd=${fd}&onlyCurrent=${onlyCurrent}`;
if (format === 'JSON') { if (format === 'JSON') {
const responseData = await apiRequest.call( const responseData = await apiRequest.call(