From c8ee577f38b2ff6171ee1f41243b4fd6497f26be Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 14 Aug 2014 02:25:18 +0200 Subject: [PATCH] Helper expanded --- Handler/Login.hs | 6 ------ Helper.hs | 7 +++++++ eidolon.cabal | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Handler/Login.hs b/Handler/Login.hs index d2125a9..627af3b 100644 --- a/Handler/Login.hs +++ b/Handler/Login.hs @@ -35,12 +35,6 @@ postLoginR = do setMessage $ [shamlet|
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
diff --git a/Helper.hs b/Helper.hs
index 0fd0d33..ce6316a 100644
--- a/Helper.hs
+++ b/Helper.hs
@@ -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' _ = ""
diff --git a/eidolon.cabal b/eidolon.cabal
index 1101388..c5ada64 100644
--- a/eidolon.cabal
+++ b/eidolon.cabal
@@ -14,6 +14,7 @@ Flag library-only
 library
     exposed-modules: Application
                      Foundation
+                     Helper
                      Import
                      Model
                      Settings