mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
feat(Discourse Node): Add new options to Get Users (#7674)
This commit is contained in:
parent
b1f678856b
commit
2e8c841277
|
@ -372,6 +372,24 @@ export class Discourse implements INodeType {
|
|||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const flag = this.getNodeParameter('flag', i) as boolean;
|
||||
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
if (options.stats) {
|
||||
qs.stats = options.stats as boolean;
|
||||
}
|
||||
|
||||
if (options.asc) {
|
||||
qs.asc = options.asc as boolean;
|
||||
}
|
||||
|
||||
if (options.showEmails) {
|
||||
qs.show_emails = options.showEmails as boolean;
|
||||
}
|
||||
|
||||
if (options.order) {
|
||||
qs.order = options.order as string;
|
||||
}
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
|
|
|
@ -215,6 +215,10 @@ export const userFields: INodeProperties[] = [
|
|||
name: 'Suspect',
|
||||
value: 'suspect',
|
||||
},
|
||||
{
|
||||
name: 'Suspended',
|
||||
value: 'suspended',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
|
@ -256,4 +260,93 @@ export const userFields: INodeProperties[] = [
|
|||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Ascending',
|
||||
name: 'asc',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to sort ascending',
|
||||
},
|
||||
{
|
||||
displayName: 'Order',
|
||||
name: 'order',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Created',
|
||||
value: 'created',
|
||||
},
|
||||
{
|
||||
name: 'Days Visited',
|
||||
value: 'days_visited',
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
value: 'email',
|
||||
},
|
||||
{
|
||||
name: 'Last Emailed',
|
||||
value: 'last_emailed',
|
||||
},
|
||||
{
|
||||
name: 'Posts',
|
||||
value: 'posts',
|
||||
},
|
||||
{
|
||||
name: 'Posts Read',
|
||||
value: 'posts_read',
|
||||
},
|
||||
{
|
||||
name: 'Read Time',
|
||||
value: 'read_time',
|
||||
},
|
||||
{
|
||||
name: 'Seen',
|
||||
value: 'seen',
|
||||
},
|
||||
{
|
||||
name: 'Topics Viewed',
|
||||
value: 'topics_viewed',
|
||||
},
|
||||
{
|
||||
name: 'Trust Level',
|
||||
value: 'trust_level',
|
||||
},
|
||||
{
|
||||
name: 'Username',
|
||||
value: 'username',
|
||||
},
|
||||
],
|
||||
default: 'created',
|
||||
description: 'What to order by',
|
||||
},
|
||||
{
|
||||
displayName: 'Show Emails',
|
||||
name: 'showEmails',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to include user email addresses',
|
||||
},
|
||||
{
|
||||
displayName: 'Stats',
|
||||
name: 'stats',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to return user stats',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue