+ assets
This commit is contained in:
@@ -27,8 +27,8 @@ class AssetsRepo:
|
||||
|
||||
return assets
|
||||
|
||||
async def get_asset(self, asset_id: str) -> Asset:
|
||||
res = await self.collection.find_one({"_id": ObjectId(asset_id)})
|
||||
async def get_asset(self, asset_id: str, with_data: bool = True) -> Asset:
|
||||
res = await self.collection.find_one({"_id": ObjectId(asset_id)}, {"data": 0 if not with_data else 1})
|
||||
res["id"] = str(res.pop("_id"))
|
||||
return Asset(**res)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user