from flask import jsonify from werkzeug.wrappers import Response import screens from core.flask_app import app @app.route("/game//flow/nodes//run-status", methods=["POST"]) def flow_node_run_status(slug: str, node_id: int) -> Response | tuple[Response, int]: """Exécuté côté serveur au moment du clic, en mode jouable, pour un nœud Action de type "Définir le statut de la partie" — voir db/scoring/, screens/data_actions/apply_status_action.py.""" node = screens.get_flow_node(slug, node_id) if not node or node.get("node_type") != "action" or node.get("action_type") != "definir_statut_partie": return jsonify({"ok": False}), 400 ok = screens.apply_status_action(slug, node) return jsonify({"ok": ok})