Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: journal updates counter fixed #5696

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading