删除试卷管理列表页未使用的 countQuestions 死代码(评审发现)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
522ff91525
commit
3de907164b
@@ -18,15 +18,6 @@ const MONTH_LABEL: Record<number, string> = {
|
|||||||
};
|
};
|
||||||
const MONTH_ORDER = [0, 9, 10, 11, 12, 1];
|
const MONTH_ORDER = [0, 9, 10, 11, 12, 1];
|
||||||
|
|
||||||
function countQuestions(qs: string): number {
|
|
||||||
try {
|
|
||||||
const arr = JSON.parse(qs) as unknown[];
|
|
||||||
return Array.isArray(arr) ? arr.length : 0;
|
|
||||||
} catch {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function ExamsAdmin() {
|
export default async function ExamsAdmin() {
|
||||||
const parent = await getSessionUser();
|
const parent = await getSessionUser();
|
||||||
if (!parent) redirect("/login");
|
if (!parent) redirect("/login");
|
||||||
|
|||||||
Reference in New Issue
Block a user