Some fixes and improvements

This commit is contained in:
Jan Oberhauser 2021-10-09 14:32:51 -05:00
parent 9e2298eb73
commit 8a39e92348

View file

@ -270,7 +270,7 @@ export class Pipedrive implements INodeType {
{ {
name: 'Get All', name: 'Get All',
value: 'getAll', value: 'getAll',
description: 'Get all products in a deal', description: 'Get all activities of a deal',
}, },
], ],
default: 'getAll', default: 'getAll',
@ -3471,7 +3471,7 @@ export class Pipedrive implements INodeType {
], ],
}, },
}, },
description: 'The ID of the deal whose products to retrieve', description: 'The ID of the deal whose activity to retrieve',
}, },
{ {
displayName: 'Additional Fields', displayName: 'Additional Fields',
@ -3493,32 +3493,20 @@ export class Pipedrive implements INodeType {
{ {
displayName: 'Done', displayName: 'Done',
name: 'done', name: 'done',
type: 'options', type: 'boolean',
options: [ default: false,
{
name: 'Not done',
value: '0',
},
{
name: 'Done',
value: '1',
},
],
default: '0',
description: 'Whether the activity is done or not.', description: 'Whether the activity is done or not.',
}, },
{ {
displayName: 'Exclude Activity Ids', displayName: 'Exclude Activity IDs',
name: 'exclude', name: 'exclude',
type: 'string', type: 'string',
typeOptions: {
rows: 3,
},
default: '', default: '',
description: 'A comma separated Activity Ids, to exclude from result. Ex. 4, 9, 11, ...', description: 'A comma separated Activity Ids, to exclude from result. Ex. 4, 9, 11, ...',
}, },
], ],
}, },
// ---------------------------------------- // ----------------------------------------
// lead: getAll // lead: getAll
// ---------------------------------------- // ----------------------------------------
@ -4423,8 +4411,8 @@ export class Pipedrive implements INodeType {
qs.exclude = (additionalFields.exclude as string); qs.exclude = (additionalFields.exclude as string);
} }
if (additionalFields.done) { if (additionalFields && additionalFields.done !== undefined) {
qs.done = parseInt(additionalFields.done as string); qs.done = additionalFields.done === true ? 1 : 0;
} }
endpoint = `/deals/${dealId}/activities`; endpoint = `/deals/${dealId}/activities`;
@ -5025,7 +5013,7 @@ export class Pipedrive implements INodeType {
returnData.push(responseData.data as IDataObject); returnData.push(responseData.data as IDataObject);
} }
} }
} catch (error: any) { } catch (error) {
if (this.continueOnFail()) { if (this.continueOnFail()) {
if (resource === 'file' && operation === 'download') { if (resource === 'file' && operation === 'download') {
items[i].json = { error: error.message }; items[i].json = { error: error.message };