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