From a1a47aceecb05fa0d44c9fd1ed5fb655f1223d5c Mon Sep 17 00:00:00 2001 From: Eddie Ferrer Date: Mon, 6 Nov 2023 09:11:43 -0700 Subject: [PATCH] fix: change query param on new teams page --- src/pages/LendingTeams/TeamLeaderboards.vue | 8 ++++---- src/pages/LendingTeams/TeamListing.vue | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/LendingTeams/TeamLeaderboards.vue b/src/pages/LendingTeams/TeamLeaderboards.vue index 91304dc5c3..c1a8e57550 100644 --- a/src/pages/LendingTeams/TeamLeaderboards.vue +++ b/src/pages/LendingTeams/TeamLeaderboards.vue @@ -41,10 +41,10 @@ export default { }; }, watch: { - '$route.query.teamCategory': { - handler(teamCategory) { - if (teamCategory !== '') { - this.teamCategory = teamCategory; + '$route.query.category': { + handler(category) { + if (category !== '') { + this.teamCategory = category; this.getLeaderboards(); } }, diff --git a/src/pages/LendingTeams/TeamListing.vue b/src/pages/LendingTeams/TeamListing.vue index 14e01d263e..a59f270b7c 100644 --- a/src/pages/LendingTeams/TeamListing.vue +++ b/src/pages/LendingTeams/TeamListing.vue @@ -265,9 +265,9 @@ const urlParamTransform = { return page > 1 ? String(page) : undefined; } }, - teamCategory: { - to({ teamCategory }) { - return teamCategory; + category: { + to({ category }) { + return category; } }, teamOption: { @@ -352,7 +352,7 @@ export default { urlParams() { return toUrlParams({ offset: this.offset, - ...(this.teamCategory !== '' && { teamCategory: this.teamCategory }), + ...(this.teamCategory !== '' && { category: this.teamCategory }), ...(this.teamOption !== '' && { teamOption: this.teamOption }), teamSort: this.teamSort, queryString: this.queryString, @@ -395,13 +395,13 @@ export default { pushToRouter('page'); return; } - if (this.teamCategory && this.teamCategory !== this.$route.query?.teamCategory) { - pushToRouter('teamCategory'); + if (this.teamCategory && this.teamCategory !== this.$route.query?.category) { + pushToRouter('category'); return; } - if (this.teamCategory === '' && this.teamCategory !== this.$route.query?.teamCategory) { + if (this.teamCategory === '' && this.teamCategory !== this.$route.query?.category) { const query = { ...this.$route.query }; - delete query?.teamCategory; + delete query?.category; this.$router.replace({ query }); } if (this.teamOption && this.teamOption !== this.$route.query?.teamOption) { @@ -410,7 +410,7 @@ export default { } if (this.teamOption === '' && this.teamOption !== this.$route.query?.teamOption) { const query = { ...this.$route.query }; - delete query?.teamCategory; + delete query?.teamOption; this.$router.replace({ query }); } if (this.queryString && this.queryString !== this.$route.query?.queryString) { @@ -423,7 +423,7 @@ export default { }, updateFromParams(query) { this.offset = getPageOffset(query, this.limit); - this.teamCategory = query.teamCategory ?? ''; + this.teamCategory = query.category ?? ''; this.teamOption = query.teamOption ?? ''; this.teamSort = query.teamSort ?? 'overallLoanedAmount'; this.queryString = query.queryString ?? '';