synchronize with 0.3.0 branch

This commit is contained in:
Lucy Cifferello
2021-09-23 19:40:39 -06:00
committed by Keagan McClelland
parent 16251afd35
commit 6fc7431930
4 changed files with 41 additions and 49 deletions

View File

@@ -3,11 +3,11 @@
module Lib.Types.Category where
import Startlude
import Database.Persist.Postgresql
import Data.Aeson
import Control.Monad
import Yesod.Core
import Startlude
import Database.Persist.Postgresql
import Data.Aeson
import Control.Monad
import Yesod.Core
data CategoryTitle = FEATURED
| BITCOIN
@@ -45,28 +45,4 @@ instance FromJSON CategoryTitle where
instance ToContent CategoryTitle where
toContent = toContent . toJSON
instance ToTypedContent CategoryTitle where
<<<<<<< HEAD
toTypedContent = toTypedContent . toJSON
<<<<<<< HEAD
=======
instance FromField CategoryTitle where
fromField a = fromJSONField a
instance FromField [CategoryTitle] where
fromField a = fromJSONField a
instance ToField [CategoryTitle] where
toField a = toJSONField a
parseCT :: Text -> CategoryTitle
parseCT = \case
"featured" -> FEATURED
"bitcoin" -> BITCOIN
"lightning" -> LIGHTNING
"data" -> DATA
"messaging" -> MESSAGING
"social" -> SOCIAL
"alt coin" -> ALTCOIN
-- _ -> fail "unknown category title"
>>>>>>> aggregate query functions
=======
toTypedContent = toTypedContent . toJSON
>>>>>>> clean up