(feat) /user/get_requests

This commit is contained in:
ishaan-jaff 2024-02-19 17:04:13 -08:00
parent 6985880506
commit 854a7c92d5
2 changed files with 53 additions and 1 deletions

View file

@ -512,7 +512,9 @@ class PrismaClient:
user_id_list: Optional[list] = None,
team_id: Optional[str] = None,
key_val: Optional[dict] = None,
table_name: Optional[Literal["user", "key", "config", "spend", "team"]] = None,
table_name: Optional[
Literal["user", "key", "config", "spend", "team", "user_notification"]
] = None,
query_type: Literal["find_unique", "find_all"] = "find_unique",
expires: Optional[datetime] = None,
reset_at: Optional[datetime] = None,
@ -677,6 +679,14 @@ class PrismaClient:
where={"members": {"has": user_id}}
)
return response
elif table_name == "user_notification":
if query_type == "find_unique":
response = await self.db.litellm_usernotifications.find_unique(
where={"user_id": user_id} # type: ignore
)
elif query_type == "find_all":
response = await self.db.litellm_usernotifications.find_many()
return response
except Exception as e:
print_verbose(f"LiteLLM Prisma Client Exception: {e}")
import traceback