From 0c71b2c0b4a9cbce47446d94b88a0f190c38966d Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Mon, 26 Aug 2024 10:44:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=20=EA=B2=80=EC=83=89=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=EC=8B=9C=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?1=EB=A1=9C=20=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/users/Users.jsx | 5 ++--- packages/adminPage/src/features/users/index.jsx | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/adminPage/src/features/users/Users.jsx b/packages/adminPage/src/features/users/Users.jsx index 69c5f6b..1e30a52 100644 --- a/packages/adminPage/src/features/users/Users.jsx +++ b/packages/adminPage/src/features/users/Users.jsx @@ -1,10 +1,9 @@ import { useQuery } from "@common/dataFetch/getQuery.js"; import { fetchServer } from "@common/dataFetch/fetchServer.js"; import Pagination from "@admin/components/Pagination"; -import { useState } from "react"; -export default function Comments({ searchParams }) { - const [page, setPage] = useState(1); +export default function Comments({ searchParams, page, setPage }) { + const data = useQuery( "admin-users", () => diff --git a/packages/adminPage/src/features/users/index.jsx b/packages/adminPage/src/features/users/index.jsx index 69b547b..ce683b0 100644 --- a/packages/adminPage/src/features/users/index.jsx +++ b/packages/adminPage/src/features/users/index.jsx @@ -8,11 +8,13 @@ export default function AdminCommentID() { const [formString, setFormString] = useState(""); const [searchString, setSearchString] = useState(""); const [category, setCategory] = useState("userName"); + const [page, setPage] = useState(1); const [searchParams, setSearchParams] = useSearchParams(); function searchComment(e) { e.preventDefault(); + setPage(1); setSearchString(formString); setSearchParams({ search: formString, field: category }); } @@ -62,7 +64,12 @@ export default function AdminCommentID() { }> - + ); From b3a3db0239e63cb6de7cf925aa1dfc7efe21bc92 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Mon, 26 Aug 2024 10:50:34 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=8C=80=ED=8F=89=20=EA=B2=80=EC=83=89=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=83=88=20=EB=AC=B8=EC=9E=90=EC=97=B4=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EC=8B=9C=20=ED=8E=98=EC=9D=B4=EC=A7=80=201?= =?UTF-8?q?=EB=A1=9C=20=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 274cf1e..dccbcf3 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 557155c..fce16ba 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} />