mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix return key aliases on /user/info
This commit is contained in:
parent
8f7bf3ad52
commit
b669e2987b
1 changed files with 14 additions and 3 deletions
|
@ -1055,9 +1055,20 @@ class PrismaClient:
|
|||
},
|
||||
)
|
||||
else:
|
||||
response = await self.db.litellm_usertable.find_many( # type: ignore
|
||||
order={"spend": "desc"}, take=limit, skip=offset
|
||||
)
|
||||
# return all users in the table, get their key aliases ordered by spend
|
||||
sql_query = """
|
||||
SELECT
|
||||
u.*,
|
||||
json_agg(v.key_alias) AS key_aliases
|
||||
FROM
|
||||
"LiteLLM_UserTable" u
|
||||
LEFT JOIN "LiteLLM_VerificationToken" v ON u.user_id = v.user_id
|
||||
GROUP BY
|
||||
u.user_id
|
||||
LIMIT $1
|
||||
OFFSET $2
|
||||
"""
|
||||
response = await self.db.query_raw(sql_query, limit, offset)
|
||||
return response
|
||||
elif table_name == "spend":
|
||||
verbose_proxy_logger.debug(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue