Helper expanded
This commit is contained in:
parent
0ab0552f20
commit
c8ee577f38
3 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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' _ = ""
|
||||
|
|
|
@ -14,6 +14,7 @@ Flag library-only
|
|||
library
|
||||
exposed-modules: Application
|
||||
Foundation
|
||||
Helper
|
||||
Import
|
||||
Model
|
||||
Settings
|
||||
|
|
Loading…
Reference in a new issue