From b3a3db0239e63cb6de7cf925aa1dfc7efe21bc92 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Mon, 26 Aug 2024 10:50:34 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=96=B4=EB=93=9C=EB=AF=BC=20=EA=B8=B0?= =?UTF-8?q?=EB=8C=80=ED=8F=89=20=EA=B2=80=EC=83=89=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=83=88=20=EB=AC=B8=EC=9E=90=EC=97=B4=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EC=8B=9C=20=ED=8E=98=EC=9D=B4=EC=A7=80=201=EB=A1=9C=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/adminPage/src/features/comment/id/Comments.jsx | 5 +++-- packages/adminPage/src/features/comment/id/index.jsx | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/adminPage/src/features/comment/id/Comments.jsx b/packages/adminPage/src/features/comment/id/Comments.jsx index 274cf1ee..dccbcf36 100644 --- a/packages/adminPage/src/features/comment/id/Comments.jsx +++ b/packages/adminPage/src/features/comment/id/Comments.jsx @@ -2,7 +2,6 @@ import { useQuery } from "@common/dataFetch/getQuery.js"; import { fetchServer } from "@common/dataFetch/fetchServer.js"; import { formatDate } from "@common/utils.js"; import Pagination from "@admin/components/Pagination"; -import { useState } from "react"; export default function Comments({ eventId, @@ -10,8 +9,10 @@ export default function Comments({ setCheckedComments, setAllId, searchString, + page, + setPage }) { - const [page, setPage] = useState(1); + const data = useQuery( eventId, () => diff --git a/packages/adminPage/src/features/comment/id/index.jsx b/packages/adminPage/src/features/comment/id/index.jsx index 557155c6..fce16ba9 100644 --- a/packages/adminPage/src/features/comment/id/index.jsx +++ b/packages/adminPage/src/features/comment/id/index.jsx @@ -9,6 +9,7 @@ export default function AdminCommentID({ eventId }) { const [formString, setFormString] = useState(""); const [searchString, setSearchString] = useState(""); const [allId, setAllId] = useState([]); + const [page, setPage] = useState(1); function selectAll() { if (allId.every((id) => checkedComments.has(id))) { @@ -26,6 +27,7 @@ export default function AdminCommentID({ eventId }) { function searchComment(e) { e.preventDefault(); + setPage(1); setSearchString(formString); } @@ -78,6 +80,8 @@ export default function AdminCommentID({ eventId }) { setCheckedComments={setCheckedComments} setAllId={setAllId} searchString={searchString} + page={page} + setPage={setPage} />