Skip to content

Commit

Permalink
Merge pull request #5692 from kiva/fix-lent-to-countries-stat
Browse files Browse the repository at this point in the history
fix: lent to countries stat
  • Loading branch information
christian14b authored Nov 18, 2024
2 parents d648c40 + 5f926b0 commit 68db402
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/MyKiva/MyKivaStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ onMounted(() => {
totalAmountLent.value = result.data?.my?.userStats?.amount_of_loans ?? 0;
// Handle new user use-case
totalAmountLent.value = totalAmountLent.value === '0.00' ? 0 : totalAmountLent.value;
totalCountriesLentTo.value = result.data?.my?.statsPerCountry?.totalCount ?? 0;
totalCountriesLentTo.value = result.data?.my?.lendingStats?.lentTo?.countries?.totalCount ?? 0;
isLoaded.value = true;
}).catch(e => {
logReadQueryError(e, 'MyKivaPage myKivaQuery');
Expand Down
19 changes: 11 additions & 8 deletions src/graphql/query/myLendingStats.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ query myLendingStats {
name
}
lentTo {
borrowers {
totalCount
}
}
borrowers {
totalCount
}
countries {
totalCount
}
}
}
userStats {
amount_of_loans
}
amount_of_loans
}
statsPerCountry {
totalCount
}
totalCount
}
}
lend {
countryFacets {
Expand Down

0 comments on commit 68db402

Please sign in to comment.