This commit is contained in:
2026-07-07 18:58:53 +08:00
parent 5ebb64a5c4
commit 9cef3106f3
7 changed files with 125 additions and 37 deletions
+4 -2
View File
@@ -245,13 +245,14 @@ async def get_join_info_public(
@router.get("/join-requests", )
async def list_join_requests(
status: str | None = Query(None),
current_user: User = Depends(get_current_user),
db: AsyncSession = Depends(get_db),
):
team = await get_managed_team(db, current_user.id)
if not team:
raise HTTPException(status_code=403, detail="只有团队管理人可查看")
requests = await team_invitation_service.get_pending_requests(db, team.id)
requests = await team_invitation_service.get_all_requests(db, team.id, status)
# 获取团队名
team_name_result = await db.execute(
@@ -269,7 +270,8 @@ async def list_join_requests(
phone=r.get("phone"),
status=r["status"],
note=r.get("note"),
created_at=r.get("created_at"),
created_at=r["created_at"],
handled_at=r.get("handled_at"),
)
for r in requests
]