mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Add search operation to Zendesk-Node (#900)
This commit is contained in:
@@ -477,6 +477,22 @@ export class Zendesk implements INodeType {
|
||||
responseData = responseData.users;
|
||||
}
|
||||
}
|
||||
//https://developer.zendesk.com/rest_api/docs/support/users#search-users
|
||||
if (operation === 'search') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
const options = this.getNodeParameter('filters', i) as IDataObject;
|
||||
|
||||
Object.assign(qs, options);
|
||||
|
||||
if (returnAll) {
|
||||
responseData = await zendeskApiRequestAllItems.call(this, 'users', 'GET', `/users/search`, {}, qs);
|
||||
} else {
|
||||
const limit = this.getNodeParameter('limit', i) as number;
|
||||
qs.per_page = limit;
|
||||
responseData = await zendeskApiRequest.call(this, 'GET', `/users/search`, {}, qs);
|
||||
responseData = responseData.users;
|
||||
}
|
||||
}
|
||||
//https://developer.zendesk.com/rest_api/docs/support/users#delete-user
|
||||
if (operation === 'delete') {
|
||||
const userId = this.getNodeParameter('id', i) as string;
|
||||
|
||||
Reference in New Issue
Block a user