Attempt to fix the message history for the webclient and REST API.
This commit is contained in:
parent
8a1728f083
commit
2c02fde8c5
2 changed files with 10 additions and 5 deletions
|
|
@ -209,9 +209,9 @@ def get_history():
|
|||
"""Retrieve message history for a specific chat room."""
|
||||
chat_room = request.args.get('chat_room', 'default')
|
||||
if chat_room not in message_history:
|
||||
return jsonify({"error": f"No history found for chat room '{chat_room}'"}), 404
|
||||
return jsonify({"messages": []}) # Return an empty list if no history exists
|
||||
|
||||
return jsonify({"chat_room": chat_room, "messages": message_history[chat_room]}), 200
|
||||
return jsonify({"messages": message_history[chat_room]})
|
||||
|
||||
# WebSocket event handlers
|
||||
@socketio.on('connect')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue