From d25280f368b2c3de2b1ba9639571bd89354f547d Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 26 Jul 2025 17:20:34 +0300 Subject: [PATCH] fixed full deals --- app/mongo.py | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) 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)