fix(09-04): fix batch Start from inline keyboard
Prepare Batch Exec now references Prepare Immediate Batch Exec directly instead of relying on $json which gets overwritten by Delete Batch Select Message. Also handles both 'action' and 'batchAction' field names. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -5017,7 +5017,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"jsCode": "// Prepare batch exec data for execution\n// Input from bexec callback (start/restart/update)\nconst data = $json;\n\n// containerNames is a comma-separated array from callback\nconst containerNames = data.containerNames || [];\nconst action = data.batchAction || 'start';\n\nreturn {\n json: {\n allMatched: containerNames.map(name => ({ Name: name, Id: null })),\n action: action,\n chatId: data.chatId,\n messageId: data.messageId\n }\n};"
|
"jsCode": "// Prepare batch exec data for execution\n// Try to get data from Prepare Immediate Batch Exec first (inline keyboard flow)\n// Fall back to $json for text command flow\nlet data;\ntry {\n data = $(\"Prepare Immediate Batch Exec\").item.json;\n} catch (e) {\n data = $json;\n}\n\n// containerNames can be array or comma-separated string\nlet containerNames = data.containerNames || data.containers || [];\nif (typeof containerNames === 'string') {\n containerNames = containerNames.split(',').filter(n => n);\n}\nif (Array.isArray(containerNames) && containerNames[0] && containerNames[0].name) {\n containerNames = containerNames.map(c => c.name);\n}\n\n// action field might be 'action' or 'batchAction'\nconst action = data.action || data.batchAction || 'start';\n\nreturn {\n json: {\n allMatched: containerNames.map(name => ({ Name: name, Id: null })),\n action: action,\n chatId: data.chatId,\n messageId: data.messageId\n }\n};"
|
||||||
},
|
},
|
||||||
"id": "code-prepare-batch-exec",
|
"id": "code-prepare-batch-exec",
|
||||||
"name": "Prepare Batch Exec",
|
"name": "Prepare Batch Exec",
|
||||||
|
|||||||
Reference in New Issue
Block a user