mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
⚡ Added get users by email
This commit is contained in:
@@ -32,7 +32,7 @@ export class Mattermost implements INodeType {
|
|||||||
description: 'Sends data to Mattermost',
|
description: 'Sends data to Mattermost',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: 'Mattermost',
|
name: 'Mattermost',
|
||||||
color: '#0058CC',
|
color: '#000000',
|
||||||
},
|
},
|
||||||
inputs: ['main'],
|
inputs: ['main'],
|
||||||
outputs: ['main'],
|
outputs: ['main'],
|
||||||
@@ -849,6 +849,11 @@ export class Mattermost implements INodeType {
|
|||||||
value: 'getAll',
|
value: 'getAll',
|
||||||
description: 'Retrieve all users',
|
description: 'Retrieve all users',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Get By Email',
|
||||||
|
value: 'getByEmail',
|
||||||
|
description: 'Get a user by email',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The operation to perform.',
|
description: 'The operation to perform.',
|
||||||
@@ -991,6 +996,27 @@ export class Mattermost implements INodeType {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// ----------------------------------
|
||||||
|
// user:getByEmail
|
||||||
|
// ----------------------------------
|
||||||
|
{
|
||||||
|
displayName: 'Email',
|
||||||
|
name: 'email',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'user',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'getByEmail',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
description: `User's email`,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1332,6 +1358,16 @@ export class Mattermost implements INodeType {
|
|||||||
|
|
||||||
endpoint = `/users`;
|
endpoint = `/users`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (operation === 'getByEmail') {
|
||||||
|
// ----------------------------------
|
||||||
|
// user:getByEmail
|
||||||
|
// ----------------------------------
|
||||||
|
const email = this.getNodeParameter('email', i) as string;
|
||||||
|
requestMethod = 'GET';
|
||||||
|
endpoint = `users/email/${email}`;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`The resource "${resource}" is not known!`);
|
throw new Error(`The resource "${resource}" is not known!`);
|
||||||
|
|||||||
Reference in New Issue
Block a user