This commit is contained in:
xds
2026-02-03 14:42:48 +03:00
parent 7050999ed8
commit a1dc734cdb
2 changed files with 26 additions and 6 deletions

View File

@@ -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)