first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from flask import jsonify
|
||||
|
||||
import screens
|
||||
|
||||
from core.flask_app import app
|
||||
|
||||
|
||||
@app.route("/game/<slug>/flow/nodes/<int:node_id>/run-data", methods=["POST"])
|
||||
def flow_node_run_data(slug, node_id):
|
||||
"""Exécuté côté serveur au moment du clic, en mode jouable, pour un nœud
|
||||
Action de type "Modifier une donnée d'un objet" — identique au
|
||||
fonctionnement de l'ancienne action_run_data, mais lit sa config depuis
|
||||
un nœud du graphe de logique plutôt que depuis la table _actions."""
|
||||
node = screens.get_flow_node(slug, node_id)
|
||||
if not node or node.get("node_type") != "action" or node.get("action_type") != "modifier_donnee":
|
||||
return jsonify({"ok": False}), 400
|
||||
ok = screens.apply_data_action(slug, node)
|
||||
return jsonify({"ok": ok})
|
||||
Reference in New Issue
Block a user