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 (