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