diff options
author | Joris | 2017-06-05 18:02:13 +0200 |
---|---|---|
committer | Joris | 2017-06-05 18:02:13 +0200 |
commit | 0b191f5c48edffc9da3e38c284e9640fd82e7cb1 (patch) | |
tree | c729e53822e7c41c1a854d82d25636e58ee65c9f /src/server/Json.hs | |
parent | 5c110716cfda6e616a795edd12f2012b132dca9f (diff) |
Replace persistent by sqlite-simple
Diffstat (limited to 'src/server/Json.hs')
-rw-r--r-- | src/server/Json.hs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/server/Json.hs b/src/server/Json.hs index 408742a..cc6327a 100644 --- a/src/server/Json.hs +++ b/src/server/Json.hs @@ -6,19 +6,14 @@ module Json , jsonId ) where -import Web.Scotty - +import Data.Int (Int64) +import Data.Text (Text) import qualified Data.Aeson.Types as Json import qualified Data.HashMap.Strict as M -import Data.Text (Text) - -import Database.Persist -import Database.Persist.Sqlite - -import Model.Database +import Web.Scotty jsonObject :: [(Text, Json.Value)] -> ActionM () jsonObject = json . Json.Object . M.fromList -jsonId :: (ToBackendKey SqlBackend a) => Key a -> ActionM () -jsonId key = json . Json.Object . M.fromList $ [("id", Json.Number . fromIntegral . keyToInt64 $ key)] +jsonId :: Int64 -> ActionM () +jsonId key = json . Json.Object . M.fromList $ [("id", Json.Number . fromIntegral $ key)] |