fixed sorting
This commit is contained in:
parent
99cef43899
commit
98039b6009
|
|
@ -19,8 +19,8 @@ class ChainRepository:
|
|||
return chain
|
||||
|
||||
async def get_list(self) -> List[Chain]:
|
||||
sort_order = [("last_modified", pymongo.DESCENDING)]
|
||||
chains = [chain async for chain in self.collection.find().sort(sort_order)]
|
||||
sort_order = ("lastModified", pymongo.DESCENDING)
|
||||
chains = [chain async for chain in self.collection.find().sort(*sort_order)]
|
||||
return TypeAdapter(List[Chain]).validate_python(chains)
|
||||
|
||||
async def get_by_id(self, chain_id: str) -> Chain | None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user