mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
⚡ Minor improvement to Pipedrive-Node
This commit is contained in:
@@ -49,7 +49,7 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio
|
|||||||
|
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "application/json",
|
Accept: 'application/json',
|
||||||
},
|
},
|
||||||
method,
|
method,
|
||||||
qs: query,
|
qs: query,
|
||||||
|
|||||||
@@ -2160,6 +2160,13 @@ export class Pipedrive implements INodeType {
|
|||||||
default: '',
|
default: '',
|
||||||
description: 'Will filter Deals by the provided Organization ID.',
|
description: 'Will filter Deals by the provided Organization ID.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'RAW Data',
|
||||||
|
name: 'rawData',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: `Returns the data exactly in the way it got received from the API.`,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -2708,6 +2715,15 @@ export class Pipedrive implements INodeType {
|
|||||||
|
|
||||||
if (operation === 'search' && responseData.data && responseData.data.items) {
|
if (operation === 'search' && responseData.data && responseData.data.items) {
|
||||||
responseData.data = responseData.data.items;
|
responseData.data = responseData.data.items;
|
||||||
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
if (additionalFields.rawData !== true) {
|
||||||
|
responseData.data = responseData.data.map((item: { result_score: number, item: object }) => {
|
||||||
|
return {
|
||||||
|
result_score: item.result_score,
|
||||||
|
...item.item,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(responseData.data)) {
|
if (Array.isArray(responseData.data)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user