去掉内部 ID、难度、看不懂的「功能」图标和反馈表情几列;题目名点了就是编辑。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
736 B
TypeScript
23 lines
736 B
TypeScript
import type { AdminProblemRow, AdminProblemListItem } from "utils/types"
|
|
|
|
// 把后端的列表项塑形成管理端列表行,与请求逻辑解耦。
|
|
export function toAdminProblemRow(result: AdminProblemListItem): AdminProblemRow {
|
|
return {
|
|
id: result.id,
|
|
_id: result._id,
|
|
title: result.title,
|
|
username: result.createdBy.username,
|
|
createTime: result.createTime,
|
|
visible: result.visible,
|
|
difficulty: result.difficulty,
|
|
tags: result.tags,
|
|
isSql: result.isSql,
|
|
hasAstRules: result.hasAstRules,
|
|
allowFlowchart: result.allowFlowchart,
|
|
showFlowchart: result.showFlowchart,
|
|
topReaction: result.topReaction,
|
|
solvedUsers: result.solvedUsers,
|
|
triedUsers: result.triedUsers,
|
|
}
|
|
}
|