From 81e77cdc5f2821a0f920d033ad967c68584d0ea4 Mon Sep 17 00:00:00 2001 From: SeieunYoo <101736358+SeieunYoo@users.noreply.github.com> Date: Sun, 13 Oct 2024 03:16:50 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C?= =?UTF-8?q?=20=EA=B4=80=EB=A0=A8=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20(#155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 레포지토리 입력 모달 버튼 이후에는 무조건 모달 닫기 * fix: 수강 신청한 스터디 가 없을 때는 empty 컴포넌ㅌ 보여주기 * feat: 제출 완료 버튼 누르면 dashboard data 새로 fetch, revalidateTagByName async 바꾸기 * feat: await 추가 --- apps/admin/utils/revalidateTagByName.ts | 2 +- .../AssignmentBoxButtons.tsx | 32 ++++++++++++++++--- .../AssignmentOverviewBox/index.tsx | 1 + .../RepositorySubmissionBox.tsx | 2 +- .../(.)study-application/[studyId]/page.tsx | 4 +-- .../(.)study-cancellation/[studyId]/page.tsx | 4 +-- .../_components/EmptyStudyApplication.tsx | 27 ++++++++++++++++ .../app/(afterLogin)/study-apply/page.tsx | 19 +++++++---- apps/client/utils/revalidateTagByName.ts | 2 +- 9 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 apps/client/app/(afterLogin)/study-apply/_components/EmptyStudyApplication.tsx diff --git a/apps/admin/utils/revalidateTagByName.ts b/apps/admin/utils/revalidateTagByName.ts index f813c230..e29e1b69 100644 --- a/apps/admin/utils/revalidateTagByName.ts +++ b/apps/admin/utils/revalidateTagByName.ts @@ -2,6 +2,6 @@ import { revalidateTag } from "next/cache"; -export const revalidateTagByName = (tag: string) => { +export const revalidateTagByName = async (tag: string) => { revalidateTag(tag); }; diff --git a/apps/client/app/(afterLogin)/my-study/my-assignment/_components/AssignmentContent/AssignmentOverviewBox/AssignmentBoxButtons.tsx b/apps/client/app/(afterLogin)/my-study/my-assignment/_components/AssignmentContent/AssignmentOverviewBox/AssignmentBoxButtons.tsx index 48a3b8d0..d0438e4b 100644 --- a/apps/client/app/(afterLogin)/my-study/my-assignment/_components/AssignmentContent/AssignmentOverviewBox/AssignmentBoxButtons.tsx +++ b/apps/client/app/(afterLogin)/my-study/my-assignment/_components/AssignmentContent/AssignmentOverviewBox/AssignmentBoxButtons.tsx @@ -2,6 +2,7 @@ import { Space } from "@wow-class/ui"; import { padWithZero, parseISODate } from "@wow-class/utils"; +import { studyDetailApi } from "apis/studyDetailApi"; import { studyHistoryApi } from "apis/studyHistoryApi"; import { tags } from "constants/tags"; import Link from "next/link"; @@ -16,12 +17,14 @@ interface AssignmentBoxButtonsProps { assignment: Assignment; repositoryLink?: string; buttonsDisabled?: boolean; + studyId: number; } export const AssignmentBoxButtons = ({ buttonsDisabled, assignment, repositoryLink, + studyId, }: AssignmentBoxButtonsProps) => { return ( <> @@ -34,6 +37,8 @@ export const AssignmentBoxButtons = ({ ); @@ -42,7 +47,7 @@ const PrimaryButton = ({ assignment, buttonsDisabled, repositoryLink, -}: AssignmentBoxButtonsProps) => { +}: Omit) => { const { assignmentSubmissionStatus, submissionFailureType, submissionLink } = assignment; const { primaryButtonText } = @@ -77,9 +82,11 @@ const PrimaryButton = ({ const SecondaryButton = ({ assignment, buttonsDisabled, + studyId, }: Omit) => { const { assignmentSubmissionStatus, studyDetailId, deadline, committedAt } = assignment; + if (isDeadlinePassed(deadline)) { return (