Skip to content

Commit

Permalink
fix: use default page number of 0 if no page number is passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
mcstover committed Oct 7, 2024
1 parent b7122ce commit e78b4b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/Lend/LoanChannelCategoryRecommendedByLenders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function toUrlParams(variables) {
// Turn an object of url query parameters into an object of graphql variables
function fromUrlParams(params) {
return _merge({}, ..._invokeMap(urlParamTransform, 'from', params));
return _merge({}, ..._invokeMap(urlParamTransform, 'from', params ?? { page: 0 }));
}
function getTargetedChannel(targetedRoute, allChannels) {
Expand Down Expand Up @@ -259,7 +259,7 @@ export default {
},
handleCanonicalUrl() {
let url = `https://${this.$appConfig.host}${this.$route.path}`;
if (this.$route.query.page && Number(this.$route.query.page) > 1) {
if (this.$route?.query?.page && Number(this.$route?.query?.page) > 1) {
url = `${url}?page=${this.$route.query.page}`;
}
return url;
Expand Down

0 comments on commit e78b4b6

Please sign in to comment.