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

6697 course team progress #6714

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

singharpita
Copy link
Contributor

No description provided.

Copy link
Member

@paulbert paulbert left a comment

Choose a reason for hiding this comment

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

See my comments, thanks!

courses: { '$elemMatch': { '_id': course._id } }
};
this.couchService.findAll('teams', findDocuments(selectors, 0))
.pipe(tap(teams => this.courseTeams = teams))
Copy link
Member

Choose a reason for hiding this comment

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

This tap is unnecessary. In fact both of the pipes here should just be performed in one subscribe.

};
this.couchService.findAll('teams', findDocuments(selectors, 0))
.pipe(tap(teams => this.courseTeams = teams))
.pipe(map(([ team ]) => {
Copy link
Member

Choose a reason for hiding this comment

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

When we initialize the component we should only get the list of the teams to populate the dropdown. When the selection changes we should check if we have the membership information and only then make the getTeamMembers request.

There's other problems with this block of code, also, but if you make the change above the below should be fixed, anyway.

I think you are trying to iterate over the array here, but the rxjs pipe map is different from Array.map. Since the http request returns an array of values, this map will just have the teams array returned to it and go through once.

This only runs getTeamMembers for the first team, so the members are only stored for that one team.

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

Successfully merging this pull request may close these issues.

None yet

2 participants