init auth
This commit is contained in:
@@ -26,12 +26,13 @@ class GenerationRepo:
|
||||
|
||||
async def get_generations(self, character_id: Optional[str] = None, status: Optional[GenerationStatus] = None,
|
||||
limit: int = 10, offset: int = 10) -> List[Generation]:
|
||||
args = {}
|
||||
|
||||
filter = {"is_deleted": False}
|
||||
if character_id is not None:
|
||||
args["linked_character_id"] = character_id
|
||||
filter["linked_character_id"] = character_id
|
||||
if status is not None:
|
||||
args["status"] = status
|
||||
res = await self.collection.find(args).sort("created_at", -1).skip(
|
||||
filter["status"] = status
|
||||
res = await self.collection.find(filter).sort("created_at", -1).skip(
|
||||
offset).limit(limit).to_list(None)
|
||||
generations: List[Generation] = []
|
||||
for generation in res:
|
||||
|
||||
Reference in New Issue
Block a user