mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-05 08:10:30 +00:00
refac
This commit is contained in:
parent
f138be9d8a
commit
e76f72576e
1 changed files with 4 additions and 1 deletions
|
|
@ -274,6 +274,9 @@ class UsersTable:
|
|||
else:
|
||||
query = query.order_by(User.created_at.desc())
|
||||
|
||||
# Count BEFORE pagination
|
||||
total = query.count()
|
||||
|
||||
if skip:
|
||||
query = query.offset(skip)
|
||||
if limit:
|
||||
|
|
@ -282,7 +285,7 @@ class UsersTable:
|
|||
users = query.all()
|
||||
return {
|
||||
"users": [UserModel.model_validate(user) for user in users],
|
||||
"total": db.query(User).count(),
|
||||
"total": total,
|
||||
}
|
||||
|
||||
def get_users_by_user_ids(self, user_ids: list[str]) -> list[UserModel]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue