From df2d24671dd150f77173cfd26bf2d4392c7aeeae Mon Sep 17 00:00:00 2001 From: ptyoiy <56474564+ptyoiy@users.noreply.github.com> Date: Mon, 29 Dec 2025 13:47:23 +0000 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=EB=82=A0=EC=A7=9C=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/client/src/app/api/groups/mutation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/client/src/app/api/groups/mutation.ts b/apps/client/src/app/api/groups/mutation.ts index 923b4ff5..0cab5330 100644 --- a/apps/client/src/app/api/groups/mutation.ts +++ b/apps/client/src/app/api/groups/mutation.ts @@ -22,6 +22,7 @@ import { userQueryKey } from "@/app/api/users/query"; import { useToast } from "@/common/hook/useToast"; import { HTTP_ERROR_STATUS } from "@/shared/constant/api"; import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { isBefore, startOfTomorrow } from "date-fns"; import type { HTTPError } from "ky"; import { useSession } from "next-auth/react"; import { useParams, useRouter } from "next/navigation"; @@ -287,7 +288,9 @@ export const usePostProblemMutation = (groupId: number) => { ]); ( document.querySelector( - +variables.startDate < Date.now() ? "#tab-1" : "#tab-2", + isBefore(variables.startDate, startOfTomorrow()) + ? "#tab-1" + : "#tab-2", ) as HTMLLIElement )?.click(); From 98bc7a077198153addd410bdef679b288b734899 Mon Sep 17 00:00:00 2001 From: ptyoiy <56474564+ptyoiy@users.noreply.github.com> Date: Mon, 29 Dec 2025 13:50:43 +0000 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EB=88=84=EB=9D=BD=EB=90=90=EB=8D=98?= =?UTF-8?q?=20queryKey=20=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/client/src/app/api/groups/query.ts | 4 ++++ .../problem-list/components/PendingList/index.tsx | 3 ++- apps/client/src/app/group/[groupId]/problem-list/page.tsx | 7 +++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/api/groups/query.ts b/apps/client/src/app/api/groups/query.ts index 753fae46..3b79e8be 100644 --- a/apps/client/src/app/api/groups/query.ts +++ b/apps/client/src/app/api/groups/query.ts @@ -50,6 +50,10 @@ export const groupQueryKey = { ...groupQueryKey.problems(groupId), "queued", ], + expiredProblems: (groupId: number) => [ + ...groupQueryKey.problems(groupId), + "expired", + ], search: (params: SearchRequest) => [...groupQueryKey.all(), "search", params], joinRequests: (groupId: number) => [...groupQueryKey.detail(groupId), "join-requests"] as const, diff --git a/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx b/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx index 76d756a6..c9a18244 100644 --- a/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx +++ b/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx @@ -1,4 +1,5 @@ import { getQueuedProblems } from "@/app/api/groups"; +import { groupQueryKey } from "@/app/api/groups/query"; import PendingListItem from "@/app/group/[groupId]/problem-list/components/PendingList/Item"; import { listStyle, @@ -14,7 +15,7 @@ const PendingList = ({ groupId }: { groupId: number }) => { totalPages: queuedTotalPages, setCurrentPage: setQueuedPage, } = usePaginationQuery({ - queryKey: ["queuedProblem", groupId], + queryKey: groupQueryKey.queuedProblems(groupId), queryFn: (page) => getQueuedProblems({ groupId, page, size: 7 }), }); const queuedList = queuedData?.content; diff --git a/apps/client/src/app/group/[groupId]/problem-list/page.tsx b/apps/client/src/app/group/[groupId]/problem-list/page.tsx index 631ee418..937a3594 100644 --- a/apps/client/src/app/group/[groupId]/problem-list/page.tsx +++ b/apps/client/src/app/group/[groupId]/problem-list/page.tsx @@ -1,7 +1,7 @@ "use client"; import { getExpiredProblems, getInProgressProblems } from "@/app/api/groups"; -import { useGroupRoleQueryObject } from "@/app/api/groups/query"; +import { groupQueryKey, useGroupRoleQueryObject } from "@/app/api/groups/query"; import CheckBox from "@/common/component/CheckBox"; import Sidebar from "@/common/component/Sidebar"; import TabGroup from "@/common/component/Tab"; @@ -45,8 +45,7 @@ const ProblemListPage = ({ setCurrentPage: setInProgressPage, } = usePaginationQuery({ queryKey: [ - "inProgressProblem", - +groupId, + ...groupQueryKey.inProgressProblems(+groupId), { unsolved: isUnsolvedOnlyChecked }, ], queryFn: (page) => @@ -65,7 +64,7 @@ const ProblemListPage = ({ totalPages: expiredTotalPages, setCurrentPage: setExpiredPage, } = usePaginationQuery({ - queryKey: ["expiredProblem", +groupId], + queryKey: groupQueryKey.expiredProblems(+groupId), queryFn: (page) => getExpiredProblems({ groupId: +groupId, From e6fbb5ec9f262fa8d1f8b2b9fb443639514af10d Mon Sep 17 00:00:00 2001 From: ptyoiy <56474564+ptyoiy@users.noreply.github.com> Date: Mon, 29 Dec 2025 14:24:12 +0000 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20queryKey=20=EC=BB=A8=EB=B2=A4?= =?UTF-8?q?=EC=85=98=20=EC=A0=81=EC=9A=A9=EC=9C=BC=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20searchParam=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[groupId]/problem-list/components/PendingList/index.tsx | 1 + apps/client/src/app/group/[groupId]/problem-list/page.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx b/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx index c9a18244..7bdf7835 100644 --- a/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx +++ b/apps/client/src/app/group/[groupId]/problem-list/components/PendingList/index.tsx @@ -17,6 +17,7 @@ const PendingList = ({ groupId }: { groupId: number }) => { } = usePaginationQuery({ queryKey: groupQueryKey.queuedProblems(groupId), queryFn: (page) => getQueuedProblems({ groupId, page, size: 7 }), + searchParam: "queued", }); const queuedList = queuedData?.content; diff --git a/apps/client/src/app/group/[groupId]/problem-list/page.tsx b/apps/client/src/app/group/[groupId]/problem-list/page.tsx index 937a3594..d4075f75 100644 --- a/apps/client/src/app/group/[groupId]/problem-list/page.tsx +++ b/apps/client/src/app/group/[groupId]/problem-list/page.tsx @@ -55,6 +55,7 @@ const ProblemListPage = ({ size: 3, unsolvedOnly: isUnsolvedOnlyChecked, }), + searchParam: "inProgress" }); const inProgressList = inProgressData?.content; @@ -71,6 +72,7 @@ const ProblemListPage = ({ page, size: 3, }), + searchParam: "expired" }); const expiredList = expiredData?.content; From 3584ee3f4ece1e15a23ff3365702dbc1ad7bbe62 Mon Sep 17 00:00:00 2001 From: ptyoiy <56474564+ptyoiy@users.noreply.github.com> Date: Mon, 29 Dec 2025 14:28:32 +0000 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20format=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/client/src/app/group/[groupId]/problem-list/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/app/group/[groupId]/problem-list/page.tsx b/apps/client/src/app/group/[groupId]/problem-list/page.tsx index d4075f75..5dbbca4c 100644 --- a/apps/client/src/app/group/[groupId]/problem-list/page.tsx +++ b/apps/client/src/app/group/[groupId]/problem-list/page.tsx @@ -55,7 +55,7 @@ const ProblemListPage = ({ size: 3, unsolvedOnly: isUnsolvedOnlyChecked, }), - searchParam: "inProgress" + searchParam: "inProgress", }); const inProgressList = inProgressData?.content; @@ -72,7 +72,7 @@ const ProblemListPage = ({ page, size: 3, }), - searchParam: "expired" + searchParam: "expired", }); const expiredList = expiredData?.content;