mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
- User IDs parameter is not allow when creating a channel so it got removed. - User field is not valid when inviting a user to a channel. Correct name should be users so it got renamed to it.
This commit is contained in:
parent
3c843f5c74
commit
1b0dda6ddc
|
@ -195,16 +195,6 @@ export const channelFields = [
|
||||||
default: false,
|
default: false,
|
||||||
description: 'Create a private channel instead of a public one',
|
description: 'Create a private channel instead of a public one',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Users',
|
|
||||||
name: 'users',
|
|
||||||
type: 'multiOptions',
|
|
||||||
typeOptions: {
|
|
||||||
loadOptionsMethod: 'getUsers',
|
|
||||||
},
|
|
||||||
default: [],
|
|
||||||
description: `Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -232,9 +222,9 @@ export const channelFields = [
|
||||||
description: 'The ID of the channel to invite user to.',
|
description: 'The ID of the channel to invite user to.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'User ID',
|
displayName: 'User IDs',
|
||||||
name: 'userId',
|
name: 'userIds',
|
||||||
type: 'options',
|
type: 'multiOptions',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getUsers',
|
loadOptionsMethod: 'getUsers',
|
||||||
},
|
},
|
||||||
|
|
|
@ -294,9 +294,6 @@ export class Slack implements INodeType {
|
||||||
if (additionalFields.isPrivate) {
|
if (additionalFields.isPrivate) {
|
||||||
body.is_private = additionalFields.isPrivate as boolean;
|
body.is_private = additionalFields.isPrivate as boolean;
|
||||||
}
|
}
|
||||||
if (additionalFields.users) {
|
|
||||||
body.user_ids = (additionalFields.users as string[]).join(',');
|
|
||||||
}
|
|
||||||
responseData = await slackApiRequest.call(this, 'POST', '/conversations.create', body, qs);
|
responseData = await slackApiRequest.call(this, 'POST', '/conversations.create', body, qs);
|
||||||
responseData = responseData.channel;
|
responseData = responseData.channel;
|
||||||
}
|
}
|
||||||
|
@ -370,10 +367,10 @@ export class Slack implements INodeType {
|
||||||
//https://api.slack.com/methods/conversations.invite
|
//https://api.slack.com/methods/conversations.invite
|
||||||
if (operation === 'invite') {
|
if (operation === 'invite') {
|
||||||
const channel = this.getNodeParameter('channelId', i) as string;
|
const channel = this.getNodeParameter('channelId', i) as string;
|
||||||
const userId = this.getNodeParameter('userId', i) as string;
|
const userIds = (this.getNodeParameter('userIds', i) as string[]).join(',');
|
||||||
const body: IDataObject = {
|
const body: IDataObject = {
|
||||||
channel,
|
channel,
|
||||||
user: userId,
|
users: userIds,
|
||||||
};
|
};
|
||||||
responseData = await slackApiRequest.call(this, 'POST', '/conversations.invite', body, qs);
|
responseData = await slackApiRequest.call(this, 'POST', '/conversations.invite', body, qs);
|
||||||
responseData = responseData.channel;
|
responseData = responseData.channel;
|
||||||
|
|
Loading…
Reference in a new issue