🐛 Fix parameters when inviting a user in Slack #1175 & #1130 (#1202)

- 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:
Ricardo Espinoza
2020-11-24 03:09:00 -05:00
committed by GitHub
parent 3c843f5c74
commit 1b0dda6ddc
2 changed files with 5 additions and 18 deletions

View File

@@ -294,9 +294,6 @@ export class Slack implements INodeType {
if (additionalFields.isPrivate) {
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 = responseData.channel;
}
@@ -370,10 +367,10 @@ export class Slack implements INodeType {
//https://api.slack.com/methods/conversations.invite
if (operation === 'invite') {
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 = {
channel,
user: userId,
users: userIds,
};
responseData = await slackApiRequest.call(this, 'POST', '/conversations.invite', body, qs);
responseData = responseData.channel;