修改get项目时的返回内容格式,去除多余字典层,直接返回列表。
This commit is contained in:
parent
d580c3206d
commit
752ba0b7c9
@ -39,17 +39,15 @@ async def get_project(response: Response, session: SessionDep, current_user: Use
|
||||
raise HTTPException(status_code=404, detail="Project not found or you have no projects.")
|
||||
|
||||
# 返回项目的基本信息
|
||||
return {
|
||||
"projects": [
|
||||
{
|
||||
"name": project.name,
|
||||
"requirement": project.requirement,
|
||||
"start_time": project.start_time,
|
||||
"deadline": project.deadline
|
||||
}
|
||||
for project in projects
|
||||
]
|
||||
}
|
||||
return [
|
||||
{
|
||||
"name": project.name,
|
||||
"requirement": project.requirement,
|
||||
"start_time": project.start_time,
|
||||
"deadline": project.deadline
|
||||
}
|
||||
for project in projects
|
||||
]
|
||||
|
||||
|
||||
# 新增与修改项目
|
||||
|
||||
Loading…
Reference in New Issue
Block a user