mateamt/src/Control/Journal.hs
2019-09-15 14:59:22 +02:00

25 lines
488 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module Control.Journal where
import Servant
import Control.Monad.Reader (ask)
-- internal imports
import Types
import Model.Journal
journalShow
:: Maybe (Int, AuthMethod)
-> Maybe Int
-> Maybe Int
-> MateHandler [JournalEntry]
journalShow (Just _) mlimit moffset = do
conn <- rsConnection <$> ask
selectJournalEntries mlimit moffset conn
journalShow Nothing _ _ =
throwError $ err401
{ errBody = "No Authentication present"
}