File tree 1 file changed +6
-2
lines changed 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -558,8 +558,12 @@ class ChallengesService {
558
558
if ( filter . tracks . Des ) tracks . push ( 'Design' ) ;
559
559
if ( filter . tracks . Dev ) tracks . push ( 'Development' ) ;
560
560
if ( filter . tracks . QA ) tracks . push ( 'Quality Assurance' ) ;
561
- if ( filter . openForRegistration === 'best-match' || sort . openForRegistration === { } ) {
562
- sortedChallenges = _ . sortBy ( mockRecommendedChallenges , [ 'matchScore' ] ) ;
561
+ if ( sort . openForRegistration === 'bestMatch' || sort . openForRegistration === { } ) {
562
+ const ascArray = _ . sortBy ( mockRecommendedChallenges , [
563
+ item => Math . trunc ( ( parseFloat ( item . matchScore ) + 1.0 ) / 2.0 * 100.0 ) ] ) ;
564
+ sortedChallenges = _ . reverse ( ascArray ) ;
565
+ } else if ( sort . openForRegistration === 'name' ) {
566
+ sortedChallenges = _ . sortBy ( mockRecommendedChallenges , [ 'name' ] ) ;
563
567
} else {
564
568
sortedChallenges = _ . sortBy ( mockRecommendedChallenges , [ sort . openForRegistration ] ) ;
565
569
}
You can’t perform that action at this time.
0 commit comments