module Controller.User ( getUsersAction , whoAmIAction ) where import Web.Scotty import Control.Monad.IO.Class (liftIO) import qualified Secure import Model.Database import Model.User getUsersAction :: ActionM () getUsersAction = Secure.loggedAction (\_ -> do (liftIO $ map getJsonUser <$> runDb getUsers) >>= json ) whoAmIAction :: ActionM () whoAmIAction = Secure.loggedAction (\user -> do json (getJsonUser user) )