fixup! servant-server: add spec for QueryString and DeepQuery

This commit is contained in:
Clément Delafargue 2022-12-15 16:30:55 +01:00
parent 35ac209c91
commit c45002a021
No known key found for this signature in database

View file

@ -330,7 +330,7 @@ data Filter = Filter
deriving Show deriving Show
instance FromDeepQuery Filter where instance FromDeepQuery Filter where
fromDeepQuery params = traceShowId $ do fromDeepQuery params = do
let maybeToRight l = maybe (Left l) Right let maybeToRight l = maybe (Left l) Right
age' <- maybeToRight "missing age" $ readMaybe . T.unpack =<< join (lookup ["age"] params) age' <- maybeToRight "missing age" $ readMaybe . T.unpack =<< join (lookup ["age"] params)
name' <- maybeToRight "missing name" $ join $ lookup ["name"] params name' <- maybeToRight "missing name" $ join $ lookup ["name"] params