diff --git a/frontend/src/components/community/CommunityPage.vue b/frontend/src/components/community/CommunityPage.vue index 206bb34ac..542039ca4 100644 --- a/frontend/src/components/community/CommunityPage.vue +++ b/frontend/src/components/community/CommunityPage.vue @@ -10,6 +10,14 @@ @showDiscussionDetail="showDiscussionDetail" @showNewDiscussion="showNewDiscussion"> + { + const getDiscussion = async (childCurrent) => { + if (childCurrent) { + currentPage.value = childCurrent + } + const params = new URLSearchParams() + params.append('per', perPage.value) + params.append('page', currentPage.value) isDataLoading.value = true if (!props.repoPath || props.repoPath === '') { isDataLoading.value = false @@ -87,9 +106,10 @@ } try { - const { data, error } = await useFetchApi(discussionCreateEndpoint).json() + const { data, error } = await useFetchApi(`${discussionCreateEndpoint}?${params.toString()}`).json() if (data.value) { const discussions = data.value.data.discussions || [] + totalDiscussions.value = data.value.total || 0 cards.value = discussions.sort((a, b) => b.id - a.id) } else { ElMessage({ diff --git a/frontend/src/components/community/DiscussionDetails.vue b/frontend/src/components/community/DiscussionDetails.vue index cd5de9b51..0e77c0bf3 100644 --- a/frontend/src/components/community/DiscussionDetails.vue +++ b/frontend/src/components/community/DiscussionDetails.vue @@ -1,53 +1,65 @@ - - - - - {{ title }} - - - - - - - - - - - - - - {{userName}} - · - {{ time }} + + + + + + {{ title }} + + + + + + + + + + + + + + {{userName}} + · + {{ time }} + - - - - - - - - - {{comment.user.name}} - · - - {{formatTime(comment.created_at)}} - + + + + + + + {{comment.user.name}} + · + + {{formatTime(comment.created_at)}} + + + - - + + + @@ -68,6 +80,8 @@