diff --git a/app/mongo.py b/app/mongo.py index b281fa2..77f0634 100644 --- a/app/mongo.py +++ b/app/mongo.py @@ -334,20 +334,32 @@ async def additional_deals_data(*deals: dict, full: bool): async def get_all_summaries(full: bool): - deals = await deals_collection.find({ - "$and": [ - { - "$or": [ - {"isDeleted": False}, - {"isDeleted": {"$exists": False}} - ] - }, - { - "$or": [ - {"isCompleted": False}, - {"isCompleted": {"$exists": False}} - ] - } - ] - }, {"_id": False}).sort("id", asc).to_list() + if not full: + deals = await deals_collection.find({ + "$and": [ + { + "$or": [ + {"isDeleted": False}, + {"isDeleted": {"$exists": False}} + ] + }, + { + "$or": [ + {"isCompleted": False}, + {"isCompleted": {"$exists": False}} + ] + } + ] + }, {"_id": False}).sort("id", asc).to_list() + else: + deals = await deals_collection.find({ + "$and": [ + { + "$or": [ + {"isDeleted": False}, + {"isDeleted": {"$exists": False}} + ] + } + ] + }, {"_id": False}).sort("id", asc).to_list() return await additional_deals_data(*deals, full=full)