module Handler.HistoryBG where

import Import

------------------------------------------------------------------------

getHistoryBGR :: Handler Html
getHistoryBGR = do
    Entity uid _ <- requireAuth

    -- TODO: pagination
    sugars <- fmap (map entityVal) $
              runDB $ selectList [BloodGlucoseHistoryUid ==. uid] [LimitTo 10]

    let bloodGlucoseHistoryDate _ = "TODO" :: Text -- TODO
        bloodGlucoseHistoryTime _ = "TODO" :: Text -- TODO

    defaultLayout $ do
        setTitle "Betty : Blood Sugar Logs"
        $(widgetFile "bg.history")

------------------------------------------------------------------------

{-# LANGUAGE NoDisambiguateRecordFields, NoRecordWildCards #-}

module Handler.HistoryBG where

import Import

------------------------------------------------------------------------

getHistoryBGR :: Handler Html
getHistoryBGR = do
    Entity uid _ <- requireAuth

    -- TODO: pagination
    sugars <- fmap (map entityVal) $
              runDB $ selectList [BloodGlucoseHistoryUid ==. uid] [LimitTo 10]

    let bloodGlucoseHistoryDate _ = "TODO" :: Text -- TODO
        bloodGlucoseHistoryTime _ = "TODO" :: Text -- TODO

    defaultLayout $ do
        setTitle "Betty : Blood Sugar Logs"
        $(widgetFile "bg.history")

------------------------------------------------------------------------

Fix for GHC 8.0.1 crash on travis-ci.org
Fix for GHC 8.0.1 crash on travis-ci.org

Just like 4c8283a8e7375a7fe9e9d2901ed6612b9ac3f7b4 and
17cccae6eff185a758ddf270855c287da2f26eb4, but in Handler/HistoryBG.hs
