feat: send program to backend in the latest form

ref: N25B-198
This commit is contained in:
Twirre Meulenbelt
2025-11-25 10:55:57 +01:00
parent f87c7fed03
commit 690880faa4
2 changed files with 31 additions and 10 deletions

View File

@@ -67,19 +67,29 @@ export default function TriggerNode(props: NodeProps<TriggerNode>) {
/**
* Reduces each Trigger, including its children down into its relevant data.
* @param node: The Node Properties of this node.
* @param nodes: all the nodes in the graph.
* @param node The Node Properties of this node.
* @param nodes all the nodes in the graph.
*/
export function TriggerReduce(node: Node, nodes: Node[]) {
export function TriggerReduce(node: TriggerNode, nodes: Node[]) {
// Replace this for nodes functionality
if (nodes.length <= -1) {
console.warn("Impossible nodes length in TriggerReduce")
}
const data = node.data as TriggerNodeData;
return {
label: data.label,
list: data.triggers,
}
const data = node.data;
switch (data.triggerType) {
case "keywords":
return {
id: node.id,
type: "keywords",
label: data.label,
keywords: data.triggers,
};
default:
return {
...data,
id: node.id,
};
}
}
/**