diff --git a/src/app/admin/dashboard/page.tsx b/src/app/admin/dashboard/page.tsx index 9e10851..df15946 100644 --- a/src/app/admin/dashboard/page.tsx +++ b/src/app/admin/dashboard/page.tsx @@ -30,7 +30,7 @@ export default async function AdminDashboard() { prisma.courseEnrollment.count({ where: { expiresAt: { gt: now, lte: new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000) } }, }), - prisma.homeworkSubmission.count({ where: { feedbacks: { none: {} } } }), + prisma.homeworkSubmission.count({ where: { status: { in: ["PENDING", "REVIEWING"] } } }), prisma.homeworkSubmission.count(), prisma.lessonProgress.count(), prisma.balanceTransaction.aggregate({ _sum: { amount: true } }), diff --git a/src/app/curator/dashboard/page.tsx b/src/app/curator/dashboard/page.tsx index 60fe142..2079dab 100644 --- a/src/app/curator/dashboard/page.tsx +++ b/src/app/curator/dashboard/page.tsx @@ -9,7 +9,7 @@ export default async function CuratorDashboard() { if (!session) redirect("/login"); const [pending, total, recentFeedbacks] = await Promise.all([ - prisma.homeworkSubmission.count({ where: { feedbacks: { none: {} } } }), + prisma.homeworkSubmission.count({ where: { status: { in: ["PENDING", "REVIEWING"] } } }), prisma.homeworkSubmission.count(), prisma.homeworkFeedback.count({ where: { diff --git a/src/app/curator/homework/page.tsx b/src/app/curator/homework/page.tsx index af512ee..405aa3c 100644 --- a/src/app/curator/homework/page.tsx +++ b/src/app/curator/homework/page.tsx @@ -39,8 +39,8 @@ export default async function HomeworkListPage({ searchParams }: Props) { }, } : {}), - ...(status === "pending" ? { feedbacks: { none: {} } } : {}), - ...(status === "reviewed" ? { feedbacks: { some: {} } } : {}), + ...(status === "pending" ? { status: { in: ["PENDING", "REVIEWING"] } } : {}), + ...(status === "reviewed" ? { status: { in: ["APPROVED", "REJECTED"] } } : {}), }; const [submissions, total, courses] = await Promise.all([