aboutsummaryrefslogtreecommitdiff
path: root/src/server/Controller/Index.hs
blob: db1038aaaca12cb4d25dce93b04068b0c11df63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Controller.Index
  ( getIndex
  , signOut
  ) where

import Web.Scotty

import Network.HTTP.Types.Status (ok200)

import Conf (Conf(..))
import qualified LoginSession

import qualified Model.Json.Conf as M

import View.Page (page)

getIndex :: Conf -> ActionM ()
getIndex conf = html . page $ M.Conf { M.currency = currency conf }

signOut :: ActionM ()
signOut = do
  LoginSession.delete
  status ok200