diff --git a/components/shared/List.vue b/components/shared/List.vue index 6cff99e..2114894 100644 --- a/components/shared/List.vue +++ b/components/shared/List.vue @@ -44,7 +44,7 @@

@@ -67,7 +67,7 @@ v-for="page in displayedPagesNumbers" :key="page" class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 first:rounded-s-lg last:rounded-e-lg" - :class="[currentPage == page ? 'font-bold border-primary' : '', page != '.' ? ' cursor-pointer' : '']" + :class="[currentPage - 1 == page ? 'font-bold border-primary' : '', page != '.' ? ' cursor-pointer' : '']" @click="changeTimedPage(page)" > {{ typeof page == "number" ? page + 1 : "..." }} @@ -75,7 +75,7 @@

  • sort: "date:desc", filters: { date: { - $between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`], + $between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`], }, }, pagination: { @@ -136,7 +136,13 @@ const { data: collections } = await useAsyncData("collection", () => withCount: true, }, } - : {}), + : { + pagination: { + page: 1, + pageSize: 10, + withCount: true, + }, + }), }) ); collection.value = collections.value?.data; @@ -195,7 +201,7 @@ const displayedPagesNumbers = computed(() => { function getNumber(index: number): number { if (props.data?.lookup.inverse_count) { - return pagination.value.pageCount - numberOffset.value - index + 1; + return pagination.value.total - numberOffset.value - index; } else { return numberOffset.value + index + 1; } @@ -221,7 +227,7 @@ async function changeTimedData(year: number) { sort: "date:desc", filters: { date: { - $between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`], + $between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`], }, }, pagination: { @@ -230,6 +236,7 @@ async function changeTimedData(year: number) { withCount: true, }, }); + console.log(data); collection.value = data?.data; pagination.value = (data?.meta.pagination as unknown as { page: number; @@ -248,7 +255,7 @@ async function changeTimedPage(page: number = 1) { sort: "date:desc", filters: { date: { - $between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`], + $between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`], }, }, pagination: {