Commit 83754fdf authored by Alexandre Delanoë's avatar Alexandre Delanoë

[API] Add to corpus with query

parent 3b25757d
Pipeline #698 failed with stage
...@@ -297,7 +297,7 @@ type GargPrivateAPI' = ...@@ -297,7 +297,7 @@ type GargPrivateAPI' =
-- :<|> New.Upload -- :<|> New.Upload
:<|> New.AddWithForm :<|> New.AddWithForm
-- :<|> New.AddWithQuery :<|> New.AddWithQuery
-- :<|> New.AddWithFile -- :<|> New.AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI -- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api -- :<|> "new" :> New.Api
...@@ -379,17 +379,17 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid)) ...@@ -379,17 +379,17 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
<$> PathNode <*> treeAPI <$> PathNode <*> treeAPI
-- TODO access -- TODO access
-- :<|> addUpload -- :<|> addUpload
-- (\corpus -> addWithQuery corpus :<|> addWithFile corpus) -- :<|> (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
-- :<|> addWithFile
:<|> addWithForm :<|> addWithForm
:<|> addWithQuery
-- :<|> New.api uid -- TODO-SECURITY -- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info uid -- TODO-SECURITY -- :<|> New.info uid -- TODO-SECURITY
{- {-
addUpload :: GargServer New.Upload addUpload :: GargServer New.Upload
addUpload cId = serveJobsAPI $ JobFunction (\i log -> New.addToCorpusJobFunction cid i (liftIO . log)) addUpload cId = (serveJobsAPI $ JobFunction (\i log -> New.addToCorpusJobFunction cid i (liftIO . log)))
:<|> (serveJobsAPI $ JobFunction (\i log -> New.addToCorpusWithForm cid i (liftIO . log))) :<|> (serveJobsAPI $ JobFunction (\i log -> New.addToCorpusWithForm cid i (liftIO . log)))
-} --}
addWithQuery :: GargServer New.AddWithQuery addWithQuery :: GargServer New.AddWithQuery
addWithQuery cid = addWithQuery cid =
......
...@@ -148,10 +148,10 @@ type Upload = Summary "Corpus Upload endpoint" ...@@ -148,10 +148,10 @@ type Upload = Summary "Corpus Upload endpoint"
type AddWithQuery = Summary "Add with Query to corpus endpoint" type AddWithQuery = Summary "Add with Query to corpus endpoint"
:> "corpus" :> "query"
:> Capture "corpus_id" CorpusId :> Capture "corpus_id" CorpusId
:> "add" :> "add"
:> "query" :> "corpus"
:> "async" :> "async"
:> AsyncJobsAPI ScraperStatus WithQuery ScraperStatus :> AsyncJobsAPI ScraperStatus WithQuery ScraperStatus
......
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