Skip to content

Commit

Permalink
fix: more special casing for sort in new channels
Browse files Browse the repository at this point in the history
  • Loading branch information
dyersituations committed Jul 3, 2024
1 parent eef0e9c commit 8022724
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/LoansByCategory/QuickFilters/QuickFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default {
women: false,
kivaUs: false,
endingSoon: false,
amountLeft: false,
},
};
},
Expand All @@ -226,6 +227,9 @@ export default {
} else if (this.presetFilterActive.endingSoon) {
this.resetSortBy();
this.presetFilterActive.endingSoon = false;
} else if (this.presetFilterActive.amountLeft) {
this.resetSortBy();
this.presetFilterActive.amountLeft = false;
}
// These categories use location/gender/sort by for FLSS and need
Expand All @@ -239,6 +243,9 @@ export default {
} else if (catId === 3) { // ending-soon
this.sortBy = 'expiringSoon';
this.presetFilterActive.endingSoon = true;
} else if (catId === 171 || catId === 172) { // featured-projects and basic-needs
this.sortBy = 'amountLeft';
this.presetFilterActive.amountLeft = true;
} else {
if (catId === 33 || catId === 96) { // mission-driven-orgs, covid-19
// we don't currently have this option for these categories, also irrelevant since
Expand Down Expand Up @@ -275,6 +282,9 @@ export default {
if (this.presetFilterActive.endingSoon && sortBy !== 'expiringSoon') {
this.resetCategory();
this.presetFilterActive.endingSoon = false;
} else if (this.presetFilterActive.amountLeft && sortBy !== 'amountLeft') {
this.resetCategory();
this.presetFilterActive.amountLeft = false;
}
this.$emit('update-filters', { sortBy });
this.$kvTrackEvent(
Expand Down
17 changes: 17 additions & 0 deletions src/plugins/loan-channel-query-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,23 @@ export default {
isMatchable: true
},
},
{
id: 171,
url: 'featured-projects',
flssLoanSearch: {
lenderRepaymentTerm: createMinMaxRange(0, 8),
sortBy: 'amountLeft',
},
},
{
id: 172,
url: 'basic-needs',
flssLoanSearch: {
sectorId: [10],
themeId: [8],
sortBy: 'amountLeft',
},
},
]

};
Expand Down

0 comments on commit 8022724

Please sign in to comment.