mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
Contact Delete
This commit is contained in:
@@ -80,6 +80,14 @@ export class AgileCrm implements INodeType {
|
||||
|
||||
}
|
||||
|
||||
if(operation === 'delete'){
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
|
||||
const endpoint = `api/contacts/${contactId}`;
|
||||
responseData = await agileCrmApiRequest.call(this, 'DELETE', endpoint, {});
|
||||
|
||||
}
|
||||
|
||||
if(operation === 'getAll'){
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
|
||||
@@ -30,6 +30,16 @@ export const contactOperations = [
|
||||
value: 'create',
|
||||
description: 'Create a new contact',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update contact properties',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a contact',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
description: 'The operation to perform.',
|
||||
@@ -555,9 +565,28 @@ export const contactFields = [
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
},
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* contact:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Contact ID',
|
||||
name: 'contactId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'contact',
|
||||
],
|
||||
operation: [
|
||||
'delete',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Unique identifier for a particular contact',
|
||||
},
|
||||
|
||||
] as INodeProperties[];
|
||||
|
||||
@@ -30,8 +30,8 @@ export async function agileCrmApiRequest(this: IHookFunctions | IExecuteFunction
|
||||
json: true
|
||||
};
|
||||
|
||||
// Only add Body property if method not GET to avoid 400 response
|
||||
if(method !== "GET"){
|
||||
// Only add Body property if method not GET or DELETE to avoid 400 response
|
||||
if(method !== "GET" && method !== "DELETE"){
|
||||
options.body = body;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user