feat(app): add error/loading boundaries and update dashboard routes
- Add error.tsx and loading.tsx boundaries for admin, parent, student, teacher routes - Add dashboard-error-fallback and dashboard-loading-skeleton components - Add student/learning page, parent/leave routes, teacher textbook components - Update existing app routes across auth, dashboard, and API endpoints - Update proxy middleware and next-auth type declarations
This commit is contained in:
@@ -39,16 +39,19 @@ export default async function TeacherDiagnosticPage({
|
||||
const reportType = getParam(sp, "reportType")
|
||||
const status = getParam(sp, "status")
|
||||
|
||||
const reports = await getDiagnosticReports({
|
||||
reportType: reportType && reportType !== "all" ? parseReportType(reportType) : undefined,
|
||||
status: status && status !== "all" ? parseReportStatus(status) : undefined,
|
||||
})
|
||||
const reports = await getDiagnosticReports(
|
||||
{
|
||||
reportType: reportType && reportType !== "all" ? parseReportType(reportType) : undefined,
|
||||
status: status && status !== "all" ? parseReportStatus(status) : undefined,
|
||||
},
|
||||
ctx.dataScope,
|
||||
)
|
||||
|
||||
// 学生角色仅查看自己的报告;其他角色查看全部
|
||||
const visibleReports =
|
||||
ctx.dataScope.type === "class_members"
|
||||
? reports.filter((r) => r.studentId === ctx.userId)
|
||||
: reports
|
||||
? reports.reports.filter((r) => r.studentId === ctx.userId)
|
||||
: reports.reports
|
||||
|
||||
return (
|
||||
<div className="h-full flex-1 flex-col space-y-8 p-8 md:flex">
|
||||
|
||||
Reference in New Issue
Block a user