diff options
author | Joris | 2019-10-20 21:31:57 +0200 |
---|---|---|
committer | Joris | 2019-10-20 21:31:57 +0200 |
commit | 602c52acfcfa494b07fec05c20b317b60ea8a6f3 (patch) | |
tree | 34fd9c44f82a83569822bc36eb2e0b04518e59f2 /server/src/Controller/User.hs | |
parent | 7aadcc97f9df0e2daccbe8a8726d8bc6c63d67f4 (diff) |
Load init data per page with AJAX
Diffstat (limited to 'server/src/Controller/User.hs')
-rw-r--r-- | server/src/Controller/User.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/Controller/User.hs b/server/src/Controller/User.hs new file mode 100644 index 0000000..a7bb136 --- /dev/null +++ b/server/src/Controller/User.hs @@ -0,0 +1,17 @@ +module Controller.User + ( list + ) where + +import Control.Monad.IO.Class (liftIO) +import Web.Scotty (ActionM) +import qualified Web.Scotty as S + +import qualified Model.Query as Query +import qualified Persistence.User as UserPersistence +import qualified Secure + +list :: ActionM () +list = + Secure.loggedAction (\_ -> + (liftIO . Query.run $ UserPersistence.list) >>= S.json + ) |