Fix comment pagination and change show limit to 8 items

This commit is contained in:
marzban-dev
2026-05-16 19:28:43 +03:30
parent b07336f9f1
commit 1a4fce3e13
4 changed files with 27 additions and 10 deletions
@@ -19,7 +19,6 @@ const props = defineProps<Props>();
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"
/>
<Button
v-else
v-else-if="comments.count > 3"
type="button"
variant="primary"
@click="showMoreComments = !showMoreComments"