Skip to content

Commit

Permalink
Merge pull request #67 from bento-platform/features/info-field
Browse files Browse the repository at this point in the history
handle multiple response messages
  • Loading branch information
gsfk authored Jan 9, 2024
2 parents b384e98 + 849812b commit 6385ada
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 6385ada

Please sign in to comment.