Skip to content

Commit

Permalink
fix: updates offset fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-in-kiva committed Nov 21, 2024
1 parent 30b8a54 commit f56694c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/Portfolio/MyKiva/MyKivaPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const tier = ref(null);
const isEarnedSectionModal = ref(false);
const showLoanFootnote = ref(false);
const totalLoans = ref(0);
const updatesLimit = ref(3);
const updatesOffset = ref(0);
const isLoading = computed(() => !lender.value);
Expand Down Expand Up @@ -257,7 +258,14 @@ const handleBackToJourney = () => {
};
const fetchLoanUpdates = loanId => {
apollo.query({ query: updatesQuery, variables: { loanId, limit: 3, offset: updatesOffset.value } })
apollo.query({
query: updatesQuery,
variables: {
loanId,
limit: updatesLimit.value,
offset: updatesOffset.value
}
})
.then(result => {
totalUpdates.value = result.data?.lend?.loan?.updates?.totalCount ?? 0;
const updates = result.data?.lend?.loan?.updates?.values ?? [];
Expand All @@ -268,7 +276,7 @@ const fetchLoanUpdates = loanId => {
};
const loadMoreUpdates = () => {
updatesOffset.value += 1;
updatesOffset.value += updatesLimit.value;
fetchLoanUpdates(activeLoan.value.id);
};
Expand Down

0 comments on commit f56694c

Please sign in to comment.