Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/Settings/SaveSearchItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class="tw-border-tertiary tw-mb-2"
>
<kv-button
:href="savedSearch.url"
:href="savedSearchUrl"
class="tw-mr-2 tw-mb-2 md:tw-mb-0"
>
{{ viewLoansText }}
Expand Down Expand Up @@ -65,6 +65,20 @@ export default {
};
},
computed: {
savedSearchUrl() {
// augment url for lend/filter compatibility
let ssUrl = this.savedSearch?.url ?? '';
// update url with lend/filter path
ssUrl = ssUrl.replace('lend', 'lend/filter');
// remove loanLimit of -1 which is equivalent to not being set
if (ssUrl.indexOf('loanLimit=-1') > -1) {
ssUrl = ssUrl.replace(/loanLimit=-1/, '');
}
// clear up any duplicate separators
ssUrl = ssUrl.replace(/\?&/, '?').replace(/&&/, '&');
Comment thread
dyersituations marked this conversation as resolved.
// return augmented url
return ssUrl;
},
sortByText() {
const sortType = this.savedSearch?.loanSearchCriteria?.sortBy;
return sortByNameToDisplay?.[sortType] ?? sortType;
Expand Down