Helper expanded

This commit is contained in:
nek0 2014-08-14 02:25:18 +02:00
parent 0ab0552f20
commit c8ee577f38
3 changed files with 8 additions and 6 deletions

View file

@ -35,12 +35,6 @@ postLoginR = do
setMessage $ [shamlet|<pre>User does not exist|]
redirect $ LoginR
extractKey :: KeyBackend backend entity -> Text
extractKey = extractKey' . unKey
where
extractKey' (PersistInt64 k) = pack $ show k
extractKey' _ = ""
loginForm :: Form Credentials
loginForm = renderDivs $ Credentials
<$> areq textField "Username" Nothing

View file

@ -1,5 +1,6 @@
module Helper
( getUserIdFromText
, extractKey
)
where
@ -10,3 +11,9 @@ import Database.Persist.Types
getUserIdFromText :: Text -> PersistValue
getUserIdFromText tempUserId =
PersistInt64 $ fromIntegral $ read $ unpack tempUserId
extractKey :: KeyBackend backend entity -> Text
extractKey = extractKey' . unKey
where
extractKey' (PersistInt64 k) = pack $ show k
extractKey' _ = ""

View file

@ -14,6 +14,7 @@ Flag library-only
library
exposed-modules: Application
Foundation
Helper
Import
Model
Settings