mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +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:
|
else:
|
||||||
response = await self.db.litellm_usertable.find_many( # type: ignore
|
# return all users in the table, get their key aliases ordered by spend
|
||||||
order={"spend": "desc"}, take=limit, skip=offset
|
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
|
return response
|
||||||
elif table_name == "spend":
|
elif table_name == "spend":
|
||||||
verbose_proxy_logger.debug(
|
verbose_proxy_logger.debug(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue