From 0b191f5c48edffc9da3e38c284e9640fd82e7cb1 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 5 Jun 2017 18:02:13 +0200 Subject: Replace persistent by sqlite-simple --- src/server/Json.hs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/server/Json.hs') 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)] -- cgit v1.2.3