mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
set up functionality layout
This commit is contained in:
@@ -1120,6 +1120,71 @@ export class ActiveCampaign implements INodeType {
|
||||
addAdditionalFields(body.contact as IDataObject, updateFields);
|
||||
|
||||
}
|
||||
} else if (resource === 'deal') {
|
||||
if (operation === 'create') {
|
||||
// ----------------------------------
|
||||
// deal:create
|
||||
// ----------------------------------
|
||||
|
||||
requestMethod = 'POST';
|
||||
|
||||
dataKey = 'deal';
|
||||
body.deal = {
|
||||
email: this.getNodeParameter('email', i) as string,
|
||||
} as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
addAdditionalFields(body.deal as IDataObject, additionalFields);
|
||||
|
||||
} else if (operation === 'delete') {
|
||||
// ----------------------------------
|
||||
// deal:delete
|
||||
// ----------------------------------
|
||||
|
||||
requestMethod = 'DELETE';
|
||||
|
||||
const dealId = this.getNodeParameter('dealId', i) as number;
|
||||
endpoint = `/api/3/deals/${dealId}`;
|
||||
|
||||
} else if (operation === 'get') {
|
||||
// ----------------------------------
|
||||
// deal:get
|
||||
// ----------------------------------
|
||||
|
||||
requestMethod = 'GET';
|
||||
|
||||
const dealId = this.getNodeParameter('dealId', i) as number;
|
||||
endpoint = `/api/3/deals/${dealId}`;
|
||||
|
||||
} else if (operation === 'getAll') {
|
||||
// ----------------------------------
|
||||
// persons:getAll
|
||||
// ----------------------------------
|
||||
|
||||
requestMethod = 'GET';
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
if (returnAll === false) {
|
||||
qs.limit = this.getNodeParameter('limit', i) as number;
|
||||
}
|
||||
|
||||
dataKey = 'deals';
|
||||
endpoint = `/api/3/deals`;
|
||||
|
||||
} else if (operation === 'update') {
|
||||
// ----------------------------------
|
||||
// deal:update
|
||||
// ----------------------------------
|
||||
|
||||
requestMethod = 'PUT';
|
||||
|
||||
const dealId = this.getNodeParameter('dealId', i) as number;
|
||||
endpoint = `/api/3/deals/${dealId}`;
|
||||
|
||||
dataKey = 'deal';
|
||||
body.deal = {} as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
addAdditionalFields(body.deal as IDataObject, updateFields);
|
||||
|
||||
} else {
|
||||
throw new Error(`The resource "${resource}" is not known!`);
|
||||
}
|
||||
@@ -1140,4 +1205,4 @@ export class ActiveCampaign implements INodeType {
|
||||
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user