Skip to content

Commit

Permalink
handle multiple response messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfk committed Jan 9, 2024
1 parent b384e98 commit 849812b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bento_beacon/utils/beacon_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ def init_response_data():
g.response_data = {}
g.response_info = {}


# TODO: handle multiple messages
def add_info_to_response(info):
g.response_info["message"] = info
add_message({"description": info, "level": "info"})


def add_message(message_obj):
messages = g.response_info.get("messages", [])
messages.append(message_obj)
g.response_info["messages"] = messages


def add_stats_to_response(ids):
Expand Down

0 comments on commit 849812b

Please sign in to comment.