fixed linting

This commit is contained in:
Robert 2024-03-13 03:15:12 +07:00
parent 30b5e539bd
commit e25f6cdb43
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

@ -2,7 +2,6 @@ from loguru import logger
from uuid import UUID
from typing import List
from bson import ObjectId
from pydantic import TypeAdapter
from chain_service.database.database import Database
@ -23,9 +22,7 @@ class ChainRepository:
async def get_list(self, namespace_id: str) -> List[Chain]:
# sort_order = ("lastModified", pymongo.DESCENDING)
query = {"namespaceId": namespace_id}
chains = [
chain async for chain in self.collection.find({"namespaceId": namespace_id})
]
chains = [chain async for chain in self.collection.find(query)]
return TypeAdapter(List[Chain]).validate_python(chains)
async def get_by_id(self, chain_id: str) -> Chain | None: