@@ -106,8 +106,8 @@ function filterByRegistrationOpen(challenge, state) {
106106 * @return {Boolean } True if opp satifies the filter
107107 */
108108function filterByReviewOpportunityType ( opp , state ) {
109- if ( ! state . reviewOpportunityType ) return true ;
110- return opp . type === state . reviewOpportunityType ;
109+ if ( state . reviewOpportunityTypes . length === 0 ) return false ;
110+ return state . reviewOpportunityTypes . includes ( opp . type ) ;
111111}
112112
113113function filterByStartDate ( challenge , state ) {
@@ -447,14 +447,16 @@ export function setEndDate(state, date) {
447447/**
448448 * Clones the state and sets the review opportunity type.
449449 * @param {Object } state
450- * @param {Array } reviewOpportunityType Possible values found in utils/tc REVIEW_OPPORTUNITY_TYPES
450+ * @param {Array } reviewOpportunityTypes Possible values found in utils/tc REVIEW_OPPORTUNITY_TYPES
451451 * @return {Object }
452452 */
453- export function setReviewOpportunityType ( state , reviewOpportunityType ) {
454- if ( reviewOpportunityType ) return { ...state , reviewOpportunityType } ;
455- if ( ! state . reviewOpportunityType ) return state ;
453+ export function setReviewOpportunityType ( state , reviewOpportunityTypes ) {
454+ if ( reviewOpportunityTypes && reviewOpportunityTypes . length ) {
455+ return { ...state , reviewOpportunityTypes } ;
456+ }
457+ if ( ! state . reviewOpportunityTypes ) return state ;
456458 const res = _ . clone ( state ) ;
457- delete res . reviewOpportunityType ;
459+ delete res . reviewOpportunityTypes ;
458460 return res ;
459461}
460462
0 commit comments