fix: Update pagination logic in the help center (#5693)
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
</table>
|
||||
<table-footer
|
||||
v-if="articles.length"
|
||||
:on-page-change="onPageChange"
|
||||
:current-page="Number(currentPage)"
|
||||
:current-page="currentPage"
|
||||
:total-count="totalCount"
|
||||
:page-size="pageSize"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -60,12 +60,12 @@ export default {
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 15,
|
||||
default: 25,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onPageChange(page) {
|
||||
this.$emit('on-page-change', page);
|
||||
this.$emit('page-change', page);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
<div class="container overflow-auto">
|
||||
<article-header
|
||||
:header-title="headerTitle"
|
||||
:count="articleCount"
|
||||
:count="meta.count"
|
||||
selected-value="Published"
|
||||
@newArticlePage="newArticlePage"
|
||||
/>
|
||||
<article-table
|
||||
:articles="articles"
|
||||
:article-count="articles.length"
|
||||
:current-page="Number(meta.currentPage)"
|
||||
:total-count="articleCount"
|
||||
@on-page-change="onPageChange"
|
||||
:total-count="Number(meta.count)"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
<div v-if="shouldShowLoader" class="articles--loader">
|
||||
<spinner />
|
||||
@@ -128,9 +127,9 @@ export default {
|
||||
newArticlePage() {
|
||||
this.$router.push({ name: 'new_article' });
|
||||
},
|
||||
fetchArticles() {
|
||||
fetchArticles({ pageNumber } = {}) {
|
||||
this.$store.dispatch('articles/index', {
|
||||
pageNumber: this.pageNumber,
|
||||
pageNumber: pageNumber || this.pageNumber,
|
||||
portalSlug: this.$route.params.portalSlug,
|
||||
locale: this.$route.params.locale,
|
||||
status: this.status,
|
||||
@@ -138,8 +137,8 @@ export default {
|
||||
category_slug: this.selectedCategorySlug,
|
||||
});
|
||||
},
|
||||
onPageChange(page) {
|
||||
this.fetchArticles({ pageNumber: page });
|
||||
onPageChange(pageNumber) {
|
||||
this.fetchArticles({ pageNumber });
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user