From 7d12682c6825679a955148509ba09403bc974d86 Mon Sep 17 00:00:00 2001 From: igor <93474580+lgor360@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:30:34 +0300 Subject: [PATCH] Update comments.html --- comments.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/comments.html b/comments.html index 6ea7d27..8ff6cad 100644 --- a/comments.html +++ b/comments.html @@ -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) { @@ -199,8 +199,8 @@ // функция для загрузки комментариев async function loadMoreComments() { - const posts = await fetchPosts(); - renderComments(posts); + const comments = await fetchComments(); + // renderComments(posts); page++; // увеличиваем номер страницы }