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>
This commit is contained in:
Jo-Philipp Wich 2023-08-21 15:44:36 +02:00
parent 2fd74a8239
commit 18b637fed9

View file

@ -386,16 +386,20 @@ function call(name, ...)
} }
end end
function post(name, ...) function post_on(params, name, ...)
return { return {
["type"] = "call", ["type"] = "call",
["module"] = __controller, ["module"] = __controller,
["function"] = name, ["function"] = name,
["parameters"] = select('#', ...) > 0 and {...} or nil, ["parameters"] = select('#', ...) > 0 and {...} or nil,
["post"] = true ["post"] = params
} }
end end
function post(...)
return post_on(true, ...)
end
function view(name) function view(name)
return { return {
["type"] = "view", ["type"] = "view",