aboutsummaryrefslogtreecommitdiff
path: root/src/server/Controller/Index.hs
blob: e4ec7290a329f32938037a8765cc5ae61d6c1ed2 (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 Config (Config(..))
import qualified LoginSession

import qualified Model.Json.Config as M

import View.Page (page)

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

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