This commit is contained in:
emmatveev 2024-05-01 16:21:51 +03:00
parent 8d68450710
commit 942efb8036

2
api.py
View File

@ -18,7 +18,7 @@ def main():
@app.route('/dialog')
def dialog():
html = "<html><head></head><body>"
for message in mongo.messages_collection.find({"dialog_id": ObjectId(request.args.get('dialog_id'))}).sort([('sent_at', 1)]):
for message in mongo.messages_collection.find({"dialog_id": ObjectId(request.args.get('id'))}).sort([('sent_at', 1)]):
html += f'{message["sender"]}: {message["text"]}<br>'
html += "</body></html>"
return html