Skip to content

Commit

Permalink
Fix posts pagination (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudDauce authored Dec 19, 2024
1 parent 9e61bd6 commit 7c82655
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/beta/admin/site/posts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import { formatDate, Pagination, type User } from '@datagouv/components'
import { refDebounced } from '@vueuse/core'
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { RiMailLine } from '@remixicon/vue'
import type { AdminBadgeType, DiscussionSortedBy, PaginatedArray, Post, SortDirection } from '~/types/types'
import Breadcrumb from '~/components/Breadcrumb/Breadcrumb.vue'
import AdminTable from '~/components/AdminTable/Table/AdminTable.vue'
Expand All @@ -117,6 +116,11 @@ const qDebounced = refDebounced(q, 500) // TODO add 500 in config
const params = computed(() => {
return {
with_drafts: true,
sort: sortDirection.value,
q: qDebounced.value,
page_size: pageSize.value,
page: page.value,
}
})
Expand All @@ -126,7 +130,7 @@ function getStatus(post: Post): { label: string, type: AdminBadgeType } {
if (post.published) {
return {
label: t('Published the {date}', { date: formatDate(post.published) }),
type: 'success',
type: 'primary',
}
}
else {
Expand Down

0 comments on commit 7c82655

Please sign in to comment.