(20241212) Day-end push.

This commit is contained in:
2024-12-12 20:27:00 +05:30
parent e5d5c4c86d
commit e9a106dd91
10 changed files with 212 additions and 403 deletions
+4 -2
View File
@@ -144,7 +144,8 @@ class MessageController(BaseModel):
return await mongo_conn.bulk_write(
collection = self.MESSAGES_COLLECTION,
requests = mongo_operations
requests = mongo_operations,
raise_exception = True
)
# ┏┓┳┓┳┳┳┓ ┳┓ •
@@ -222,6 +223,7 @@ class MessageController(BaseModel):
projection = {
"_id": True,
"ts": True,
"tokenId": True,
"markedAsUnread": True,
"serviceType": True,
"client": True,
@@ -232,7 +234,6 @@ class MessageController(BaseModel):
"sentSuccessfully": True,
"aiSnippet": True,
"preview": True,
"message": {},
"tags": True,
"usedAi": True
},
@@ -240,6 +241,7 @@ class MessageController(BaseModel):
)
# Convert the fetched records to instances of the data model and return:
for record in records: record["message"] = {}
return [CoreMessageModel(**record) for record in records]
async def get_messages(