mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-15 03:04:27 +08:00
Remove list endpoint and related methods
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from typing import List, Optional, Type
|
||||
from typing import Optional, Type
|
||||
|
||||
from motor.motor_asyncio import AsyncIOMotorCollection
|
||||
|
||||
@ -22,9 +22,6 @@ class MongoDBUserDatabase(BaseUserDatabase[UD]):
|
||||
self.collection.create_index("id", unique=True)
|
||||
self.collection.create_index("email", unique=True)
|
||||
|
||||
async def list(self) -> List[UD]:
|
||||
return [self.user_db_model(**user) async for user in self.collection.find()]
|
||||
|
||||
async def get(self, id: str) -> Optional[UD]:
|
||||
user = await self.collection.find_one({"id": id})
|
||||
return self.user_db_model(**user) if user else None
|
||||
|
Reference in New Issue
Block a user