From 1a4fce3e131d57e5755ed1d94e6f00be349b45d8 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Sat, 16 May 2026 19:28:43 +0330 Subject: [PATCH] Fix comment pagination and change show limit to 8 items --- frontend/components/product/ProductComments.vue | 7 +++---- .../composables/api/product/useGetComments.ts | 15 +++++++++++---- frontend/composables/global/useAppParams.ts | 5 ++++- frontend/pages/product/[id].vue | 10 +++++++++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/frontend/components/product/ProductComments.vue b/frontend/components/product/ProductComments.vue index d6ff612..be37d77 100644 --- a/frontend/components/product/ProductComments.vue +++ b/frontend/components/product/ProductComments.vue @@ -19,7 +19,6 @@ const props = defineProps(); const route = useRoute(); const id = route.params.id as string | undefined; -const page = ref(1); const { token } = useAuth(); const userTitle = ref(""); @@ -28,7 +27,7 @@ const selectedRating = ref(5); const showMoreComments = ref(false); -const { data: comments, refetch: refetchComments } = useGetComments(id, page); +const { data: comments, refetch: refetchComments } = useGetComments(id); const { mutateAsync: createComment, isPending: isCreateCommentPending } = useCreateComment(id); const { mutateAsync: rateProduct, isPending: isRateProductPending } = useRateProduct(props.product.slug); @@ -209,10 +208,10 @@ const limitedComments = computed(() => { v-if="showMoreComments" :total="comments.count" :items="comments.results.map((item, i) => ({ type: 'page', value: i }))" - :per-page="3" + :per-page="8" />