Skip to content

Commit

Permalink
fix: journal updates counter fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-in-kiva committed Nov 19, 2024
1 parent b9362a2 commit 1ee71f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/MyKiva/JournalUpdatesCarousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<JournalUpdateCard
:loan="loan"
:update="update"
:update-number="`${index + 1}`"
:update-number="`${totalUpdates - index}`"
@read-more-clicked="openLightbox"
@share-loan-clicked="shareLoanClicked"
/>
Expand Down Expand Up @@ -72,6 +72,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
totalUpdates: {
type: Number,
default: 0,
},
});
const { loan, updates } = toRefs(props);
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Portfolio/MyKiva/MyKivaPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
:loan="activeLoan"
:updates="loanUpdates"
:lender="lender"
:total-updates="totalUpdates"
/>
</div>
</section>
Expand Down Expand Up @@ -187,6 +188,7 @@ const userInfo = ref({});
const loans = ref([]);
const activeLoan = ref({});
const loanUpdates = ref([]);
const totalUpdates = ref(0);
const showBadgeModal = ref(false);
const selectedBadgeData = ref();
const state = ref(STATE_JOURNEY);
Expand Down Expand Up @@ -256,6 +258,7 @@ const fetchLoanUpdates = loanId => {
apollo.query({ query: updatesQuery, variables: { loanId } })
.then(result => {
loanUpdates.value = result.data?.lend?.loan?.updates?.values ?? [];
totalUpdates.value = result.data?.lend?.loan?.updates?.totalCount ?? 0;
}).catch(e => {
logReadQueryError(e, 'MyKivaPage updatesQuery');
});
Expand Down

0 comments on commit 1ee71f9

Please sign in to comment.