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 = (