[config] proper NLP table parsing

parent 19585ea5
Pipeline #6557 passed with stages
in 44 minutes and 13 seconds
......@@ -45,10 +45,11 @@ data NLPConfig = NLPConfig { _nlp_default :: URI
deriving (Generic, Show)
instance FromValue NLPConfig where
fromValue = parseTableFromValue $ do
_nlp_default <- reqKey "EN"
fromValue v = do
_nlp_default <- parseTableFromValue (reqKey "EN") v
-- _nlp_languages <- fromValue <$> getTable
let _nlp_languages = mempty
MkTable t <- parseTableFromValue getTable v
_nlp_languages <- mapM fromValue (snd <$> t)
return $ NLPConfig { .. }
......
......@@ -120,8 +120,7 @@ mkCmd k = do
pool <- view connPool
liftBase $ withResource pool (liftBase . k)
runCmd :: (HasConnectionPool env)
=> env
runCmd :: env
-> Cmd'' env err a
-> IO (Either err a)
runCmd env m = runExceptT $ runReaderT m env
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment