1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-27 09:58:20 +01:00
antd-web-apps/info/controllers/UserController.lua
2020-06-07 19:46:59 +02:00

18 lines
369 B
Lua

BaseController:subclass(
"UserController",
{
models = {"user"}
}
)
function UserController:index(...)
local args = {...}
local data = self.user:findAll()
if not data or not data[1] then
self:error("Cannot fetch user info")
end
data[1].user = self.registry.user
self.template:set("data", data[1])
return true
end