Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to add channel command using TeamName Closes#2419 #2472

Closed
wants to merge 1 commit into from

Conversation

siddharth-vaghasia
Copy link
Contributor

@siddharth-vaghasia siddharth-vaghasia commented Jun 3, 2021

Fixes to add channel command using TeamName Closes#2419

Closes #2419

@siddharth-vaghasia siddharth-vaghasia changed the title Fixes to add channel command using TeamName #2419 Fixes to add channel command using TeamName Closes#2419 Jun 3, 2021
@waldekmastykarz
Copy link
Member

Awesome! We'll review it asap. Thank you! 👏

Copy link
Member

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the filters don't work, we should remove them on line 44 in the /joinedTeams call.

I refactored your code to:

const matchingTeams: string[] = response.value
  .filter(team => team.displayName === args.options.teamName)
  .map(team => team.id);

if (matchingTeams.length < 1) {
  return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
}

if (matchingTeams.length > 1) {
  return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${matchingTeams.join(', ')}`);
}

return Promise.resolve(matchingTeams[0]);

Good find and solution direction 👍

@waldekmastykarz
Copy link
Member

Merged manually. Thank you! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug report: Issue in adding channel to Team using TeamName parameter
2 participants