Skip to content

Commit

Permalink
Merge pull request #149 from softeerbootcamp4th/dev
Browse files Browse the repository at this point in the history
1.0.1.2 핫픽스
  • Loading branch information
darkdulgi authored Aug 26, 2024
2 parents 1920d5d + 51ecd93 commit 5b814fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/adminPage/src/features/comment/id/Comments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ 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,
checkedComments,
setCheckedComments,
setAllId,
searchString,
page,
setPage
}) {
const [page, setPage] = useState(1);

const data = useQuery(
eventId,
() =>
Expand Down
4 changes: 4 additions & 0 deletions packages/adminPage/src/features/comment/id/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand All @@ -26,6 +27,7 @@ export default function AdminCommentID({ eventId }) {

function searchComment(e) {
e.preventDefault();
setPage(1);
setSearchString(formString);
}

Expand Down Expand Up @@ -78,6 +80,8 @@ export default function AdminCommentID({ eventId }) {
setCheckedComments={setCheckedComments}
setAllId={setAllId}
searchString={searchString}
page={page}
setPage={setPage}
/>
</Suspense>
</div>
Expand Down
5 changes: 2 additions & 3 deletions packages/adminPage/src/features/users/Users.jsx
Original file line number Diff line number Diff line change
@@ -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",
() =>
Expand Down
9 changes: 8 additions & 1 deletion packages/adminPage/src/features/users/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down Expand Up @@ -62,7 +64,12 @@ export default function AdminCommentID() {
</div>

<Suspense fallback={<Loading />}>
<Users searchParams={searchParams} setSearchParams={setSearchParams} />
<Users
searchParams={searchParams}
setSearchParams={setSearchParams}
page={page}
setPage={setPage}
/>
</Suspense>
</div>
);
Expand Down

0 comments on commit 5b814fd

Please sign in to comment.