From 4d92a71848f22b6e2e45410dcf13540a86bc7851 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Sun, 30 Apr 2023 19:57:47 -0500 Subject: [PATCH] Fix firstRender accidental delete; pass apiName, version to qController.testScript --- src/qqq/components/scripts/ScriptTestForm.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qqq/components/scripts/ScriptTestForm.tsx b/src/qqq/components/scripts/ScriptTestForm.tsx index 887f38c..11b16da 100644 --- a/src/qqq/components/scripts/ScriptTestForm.tsx +++ b/src/qqq/components/scripts/ScriptTestForm.tsx @@ -70,6 +70,11 @@ function ScriptTestForm({scriptId, scriptDefinition, tableName, fieldName, recor const [testException, setTestException] = useState(null as string) const [firstRender, setFirstRender] = useState(true); + if(firstRender) + { + setFirstRender(false); + } + if(firstRender) { scriptDefinition.testInputFields.forEach((field: QFieldMetaData) => @@ -108,6 +113,8 @@ function ScriptTestForm({scriptId, scriptDefinition, tableName, fieldName, recor ///////////////////////////////////////////////////////////////// // associated record scripts - run this way (at least for now) // ///////////////////////////////////////////////////////////////// + inputValues.set("apiName", apiName); + inputValues.set("apiVersion", apiVersion); output = await qController.testScript(tableName, recordId, fieldName, code, inputValues); } else