From: Jo-Philipp Wich Date: Mon, 21 Aug 2023 13:44:36 +0000 (+0200) Subject: luci-lua-runtime: dispatcher.lua: re-add post_on() dispatch action X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=18b637fed9f58b7a3f146a004ecd5b0aef2cb058;p=openwrt-luci.git 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 --- 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",