diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-08-21 15:44:36 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-08-21 15:44:36 +0200 |
commit | 18b637fed9f58b7a3f146a004ecd5b0aef2cb058 (patch) | |
tree | fd40f5c5bd31d7ea53c0dbee2c3013c005eee587 | |
parent | 2fd74a8239c3986bb2e741e907b2a90f2833f073 (diff) |
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 <jo@mein.io>
-rw-r--r-- | modules/luci-lua-runtime/luasrc/dispatcher.lua | 8 |
1 files 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", |