Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Fixed showing top placements #587

Merged
merged 1 commit into from
Dec 1, 2015
Merged

Fixed showing top placements #587

merged 1 commit into from
Dec 1, 2015

Conversation

tladendo
Copy link
Contributor

fyi @parthshah @vikasrohit @nlitwin -- we're currently showing lowest placing submissions instead of the highest placing ones.

@@ -189,7 +189,9 @@
if (challenge.track == 'DESIGN' && challenge.userDetails.submissions && challenge.userDetails.submissions.length > 0) {
challenge.thumbnailId = challenge.userDetails.submissions[0].id;

challenge.highestPlacement = _.max(challenge.userDetails.submissions, 'placement').placement;
challenge.highestPlacement = _.min(challenge.userDetails.submissions.filter(function(submission) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are not filtering anything here, can we use map instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're filtering the ones that have falsey values for the 'placement' property.

tladendo added a commit that referenced this pull request Dec 1, 2015
@tladendo tladendo merged commit 061e265 into dev Dec 1, 2015
@nlitwin nlitwin deleted the feature/SUP-2739 branch January 26, 2016 22:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants