fix(Slack Node): User id not sent correctly to API when updating user profile (#11153)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
Ria Scholz
2024-10-08 14:35:37 +02:00
committed by GitHub
parent c70969da2b
commit ed9e61c460
2 changed files with 23 additions and 1 deletions

View File

@@ -1299,18 +1299,29 @@ export class SlackV2 implements INodeType {
options.fields = fields;
}
Object.assign(body, options);
let requestBody: IDataObject = { profile: body };
let userId;
if (options.user) {
userId = options.user;
delete body.user;
requestBody = { profile: body, user: userId };
}
responseData = await slackApiRequest.call(
this,
'POST',
'/users.profile.set',
{ profile: body },
requestBody,
qs,
);
responseData = responseData.profile;
}
}
if (resource === 'userGroup') {
//https://api.slack.com/methods/usergroups.create
if (operation === 'create') {