From 18b637fed9f58b7a3f146a004ecd5b0aef2cb058 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 21 Aug 2023 15:44:36 +0200 Subject: luci-lua-runtime: dispatcher.lua: re-add post_on() dispatch action Existing legacy Lua controllers still use the `post_on()` node dispatch action, so restore this functionality. Fixes: #6531 Signed-off-by: Jo-Philipp Wich --- modules/luci-lua-runtime/luasrc/dispatcher.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/luci-lua-runtime/luasrc/dispatcher.lua b/modules/luci-lua-runtime/luasrc/dispatcher.lua index 816c9f35e3..bbe7600c44 100644 --- a/modules/luci-lua-runtime/luasrc/dispatcher.lua +++ b/modules/luci-lua-runtime/luasrc/dispatcher.lua @@ -386,16 +386,20 @@ function call(name, ...) } end -function post(name, ...) +function post_on(params, name, ...) return { ["type"] = "call", ["module"] = __controller, ["function"] = name, ["parameters"] = select('#', ...) > 0 and {...} or nil, - ["post"] = true + ["post"] = params } end +function post(...) + return post_on(true, ...) +end + function view(name) return { ["type"] = "view", -- cgit v1.2.3