Skip to content

Commit

Permalink
Update comments.html
Browse files Browse the repository at this point in the history
  • Loading branch information
lgor360 authored Jan 9, 2025
1 parent cc5ee51 commit 7d12682
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@
headers: { "Content-Type": "application/json" }
});
const data = await response.json();
return data.posts;
return data.post_view;
}

async function fetchComments() {
const response = await fetch(`${api}/post?id=${post}`, {
const response = await fetch(`${api}/comment/list?post_id=${post}&page=${page}&limit=${limit}&sort=New`, {
method: "GET",
headers: { "Content-Type": "application/json" }
});
const data = await response.json();
return data.posts;
return data.comments;
}

function parseMarkdown(text) {
Expand Down Expand Up @@ -199,8 +199,8 @@

// функция для загрузки комментариев
async function loadMoreComments() {
const posts = await fetchPosts();
renderComments(posts);
const comments = await fetchComments();
// renderComments(posts);
page++; // увеличиваем номер страницы
}

Expand Down

0 comments on commit 7d12682

Please sign in to comment.