From 5f926b0795783ba1ad7cc3910ac5d85aa81e9e2d Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Mon, 18 Nov 2024 18:17:58 -0500 Subject: [PATCH] fix: lent countries to value --- src/components/MyKiva/MyKivaStats.vue | 2 +- src/graphql/query/myLendingStats.graphql | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/MyKiva/MyKivaStats.vue b/src/components/MyKiva/MyKivaStats.vue index 9545d5b3c4..128686ffc3 100644 --- a/src/components/MyKiva/MyKivaStats.vue +++ b/src/components/MyKiva/MyKivaStats.vue @@ -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'); diff --git a/src/graphql/query/myLendingStats.graphql b/src/graphql/query/myLendingStats.graphql index 19fb434720..a028fae3de 100644 --- a/src/graphql/query/myLendingStats.graphql +++ b/src/graphql/query/myLendingStats.graphql @@ -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 {