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

Keep lesson ids of all selections #224

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Conversation

caebr
Copy link
Collaborator

@caebr caebr commented Oct 27, 2020

Nicht nur die erste Selection verwenden um die LessonIds zu ermitteln, sondern alle.

Würdest du das noch in eine Hilfsmethode oder so auslagern?

@caebr caebr requested a review from hupf October 27, 2020 16:31
Copy link
Collaborator

@hupf hupf left a comment

Choose a reason for hiding this comment

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

Ziemlich übler Bug, ich frage mich was mir damals durch den Kopf ging. Danke fürs Fixen.

.reduce((acc, lessonIds) => {
return acc.concat(lessonIds);
}, [])
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Kleine Kosmetik:

Du loopst mit dem map und dem reduce zweimal über alle Einträge. Ich würde das in diesem Fall einfach in einem Schritt machen:

    map((selectedIds) =>
      selectedIds
        .reduce((acc, s) => [...acc, ...s.lessonIds], [])
    )

Eine Alternative wäre flatten zu verwenden:

    map((selectedIds) => uniq(flatten(selectedIds.map(s => s.lessonIds))))

Sollte nicht zusätzlich auch ein uniq gemacht werden, damit diese Lektionen nicht mehrfach vorkommen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Danke. Ich habe das nun so umgesetzt (für alle drei Fälle).

.reduce((acc, lessonIds) => {
return acc.concat(lessonIds);
}, [])
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Gleiches Thema wie oben.

.reduce((acc, lessonIds) => {
return acc.concat(lessonIds);
}, [])
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Und auch hier das gleiche Thema.

@caebr caebr force-pushed the feature/219-select-all-lesson-ids branch from 376145f to 443f64e Compare October 28, 2020 10:06
@caebr caebr force-pushed the feature/219-select-all-lesson-ids branch from 443f64e to 763bcb3 Compare October 28, 2020 11:12
@caebr caebr merged commit be2c874 into master Oct 28, 2020
@mfehlmann mfehlmann deleted the feature/219-select-all-lesson-ids branch April 21, 2022 11:42
@mfehlmann mfehlmann restored the feature/219-select-all-lesson-ids branch April 21, 2022 11:42
@mfehlmann mfehlmann deleted the feature/219-select-all-lesson-ids branch April 21, 2022 11:42
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.

2 participants