@@ -26,6 +26,8 @@ import { COMPETITION_TRACKS } from "utils/tc";
26
26
import VerifiedTag from "components/challenge-listing/VerifiedTag" ;
27
27
import MatchScore from "components/challenge-listing/ChallengeCard/MatchScore" ;
28
28
import { calculateScore } from "../../../utils/challenge-listing/helper" ;
29
+ import * as urlUtil from "utils/url" ;
30
+ import * as constants from "constants" ;
29
31
import "./style.module.scss" ;
30
32
31
33
export default function ChallengeTags ( props ) {
@@ -75,6 +77,19 @@ export default function ChallengeTags(props) {
75
77
76
78
const tags = technPlatforms . filter ( ( tag ) => ! matchSkills . includes ( tag ) ) ;
77
79
80
+ const filterByChallengeType = urlUtil . buildQueryString ( {
81
+ bucket : constants . FILTER_BUCKETS [ 1 ] ,
82
+ tracks : _ . values ( constants . FILTER_CHALLENGE_TRACK_ABBREVIATIONS ) ,
83
+ page : 1 ,
84
+ } ) ;
85
+
86
+ const filterByTag = urlUtil . buildQueryString ( {
87
+ bucket : constants . FILTER_BUCKETS [ 1 ] ,
88
+ tracks : _ . values ( constants . FILTER_CHALLENGE_TRACK_ABBREVIATIONS ) ,
89
+ page : 1 ,
90
+ types : _ . values ( constants . FILTER_CHALLENGE_TYPE_ABBREVIATIONS ) ,
91
+ } ) ;
92
+
78
93
return (
79
94
< div >
80
95
{ challengeType && (
@@ -84,7 +99,7 @@ export default function ChallengeTags(props) {
84
99
setChallengeListingFilter ( { types : [ challengeType . name ] } )
85
100
)
86
101
}
87
- to = { `${ challengesUrl } ? types[]=${ encodeURIComponent (
102
+ to = { `${ challengesUrl } ${ filterByChallengeType } & types[]=${ encodeURIComponent (
88
103
challengeType . abbreviation
89
104
) } `}
90
105
>
@@ -112,7 +127,7 @@ export default function ChallengeTags(props) {
112
127
onClick = { ( ) =>
113
128
setImmediate ( ( ) => setChallengeListingFilter ( { tags : [ tag ] } ) )
114
129
}
115
- to = { `${ challengesUrl } ? tags[]=${ encodeURIComponent ( tag ) } ` }
130
+ to = { `${ challengesUrl } ${ filterByTag } & tags[]=${ encodeURIComponent ( tag ) } ` }
116
131
>
117
132
{ tag }
118
133
</ Tag >
0 commit comments