From 4edecfb9c8ce6d36be3d239a64cb39cb423c684b Mon Sep 17 00:00:00 2001 From: woni <320753691@qq.com> Date: Wed, 10 Apr 2024 11:18:11 +0800 Subject: [PATCH] adjust event data --- app/__init__.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index bb7c633..d28084e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -79,14 +79,27 @@ def do_bitable_record_add(data) -> None: table_id = event.get("table_id") action_list = event.get("action_list") - for action in action_list: - print(action.get("action")) - print(action.get("record_id")) + actions = [action.get("action") for action in action_list] + + target_actions = ["record_edited", "record_added"] + + actions = [ + action for action in action_list if action.get("action") == "record_edited" + ] + + if target_actions >= actions: + return if table_id != "tblESHsFZwtiFROB": return - # action_list = event_data.get("action_list") + if not actions: + return + + target_action = actions[0] + print(f"table_id: {table_id}") + print(f"target_action: {target_action.get("record_id")}") + handler = (