1
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user