{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-{-# LANGUAGE UndecidableInstances #-}
---------------------------------------------------------------------
module Gargantext.API.Routes
import Gargantext.Database.Admin.Types.Hyperdata
import Gargantext.Database.Admin.Types.Node
import Gargantext.Prelude
-import Gargantext.Prelude.Config (GargConfig(..))
+import Gargantext.Prelude.Config (gc_max_docs_scrapers)
import Servant
import Servant.Auth as SA
import Servant.Auth.Swagger ()
-- TODO-ACCESS here we want to request a particular header for
-- auth and capabilities.
:<|> GargPrivateAPI
- :<|> "public" :> Public.API
+ :<|> "public" :> Public.API
type GargPrivateAPI = SA.Auth '[SA.JWT, SA.Cookie] AuthenticatedUser
addCorpusWithQuery user cid =
serveJobsAPI $
JobFunction (\q log -> do
- conf <- view hasConfig
- let limit = Just $ _gc_max_docs_scrapers conf
- New.addToCorpusWithQuery user cid q limit (liftBase . log)
+ limit <- view $ config . gc_max_docs_scrapers
+ New.addToCorpusWithQuery user cid q (Just limit) (liftBase . log)
{- let log' x = do
printDebug "addToCorpusWithQuery" x
liftBase $ log x