--- a/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Tue Jun 23 19:40:55 2020 +0200
+++ b/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Tue Jun 23 19:54:06 2020 +0200
@@ -134,6 +134,12 @@
.. serialization.serialize(state, { fatal = false }),
};
end
+ if state and data.action == "execute" then
+ data.action = "next";
+ elseif not state and data.action == "next" then
+ -- Prevent jumping directly to step 2
+ return { status = "canceled", error = "Invalid action" };
+ end
state = state or { step = 1, forms = { } };
if data.action == "next" then
@@ -163,6 +169,7 @@
local next_step = {
status = "executing",
form = current_form,
+ default = "next",
actions = {
"next", "complete"
},