refac: /users/all endpoint

This commit is contained in:
Timothy Jaeryang Baek 2025-07-18 11:46:14 +04:00
parent 67bc431247
commit 6ccf783f00
2 changed files with 14 additions and 1 deletions

View file

@ -74,6 +74,18 @@ class UserListResponse(BaseModel):
total: int
class UserInfoResponse(BaseModel):
id: str
name: str
email: str
role: str
class UserInfoListResponse(BaseModel):
users: list[UserInfoResponse]
total: int
class UserResponse(BaseModel):
id: str
name: str

View file

@ -7,6 +7,7 @@ from open_webui.models.chats import Chats
from open_webui.models.users import (
UserModel,
UserListResponse,
UserInfoListResponse,
UserRoleUpdateForm,
Users,
UserSettings,
@ -83,7 +84,7 @@ async def get_users(
return Users.get_users(filter=filter, skip=skip, limit=limit)
@router.get("/all", response_model=UserListResponse)
@router.get("/all", response_model=UserInfoListResponse)
async def get_all_users(
user=Depends(get_admin_user),
):