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/Model/Json/Category.hs | |
parent | 5c110716cfda6e616a795edd12f2012b132dca9f (diff) |
Replace persistent by sqlite-simple
Diffstat (limited to 'src/server/Model/Json/Category.hs')
-rw-r--r-- | src/server/Model/Json/Category.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/Model/Json/Category.hs b/src/server/Model/Json/Category.hs index daad4c2..8b5e527 100644 --- a/src/server/Model/Json/Category.hs +++ b/src/server/Model/Json/Category.hs @@ -2,14 +2,15 @@ module Model.Json.Category ( Category(..) + , fromCategory ) where -import GHC.Generics - import Data.Aeson import Data.Text (Text) +import GHC.Generics -import Model.Database (CategoryId) +import Model.Category (CategoryId) +import qualified Model.Category as M data Category = Category { id :: CategoryId @@ -18,3 +19,6 @@ data Category = Category } deriving (Show, Generic) instance ToJSON Category + +fromCategory :: M.Category -> Category +fromCategory category = Category (M.id category) (M.name category) (M.color category) |