mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Added get users by email
This commit is contained in:
parent
149e3686c2
commit
fad5d5e808
|
@ -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!`);
|
||||||
|
|
Loading…
Reference in a new issue