Commit 5b33c328 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Async routes.

parent 1376127f
......@@ -383,9 +383,9 @@ addWithFile cid i f =
JobFunction (\_i log -> New.addToCorpusWithFile cid i f (liftIO . log))
addWithForm :: GargServer New.AddWithForm
addWithForm cid f =
addWithForm cid =
serveJobsAPI $
JobFunction (\_i log -> New.addToCorpusWithForm cid f (liftIO . log))
JobFunction (\i log -> New.addToCorpusWithForm cid i (liftIO . log))
serverStatic :: Server (Get '[HTML] Html)
serverStatic = $(do
......
......@@ -171,18 +171,16 @@ instance ToSchema WithForm
instance FromForm WithForm
------------------------------------------------------------------------
type
AddAPI withInput = AsyncJobsAPI ScraperStatus withInput ScraperStatus
------------------------------------------------------------------------
------------------------------------------------------------------------
type AddWithQuery = Summary "Add with Query to corpus endpoint"
:> "corpus"
:> Capture "corpus_id" CorpusId
:> "add"
:> "query"
:> "async"
:> AddAPI WithQuery
:> AsyncJobsAPI2 ScraperStatus '[JSON] WithQuery ScraperStatus
type AddWithFile = Summary "Add with MultipartData to corpus endpoint"
:> "corpus"
......@@ -192,16 +190,15 @@ type AddWithFile = Summary "Add with MultipartData to corpus endpoint"
:> MultipartForm Mem (MultipartData Mem)
:> QueryParam "fileType" FileType
:> "async"
:> AddAPI ()
:> AsyncJobsAPI2 ScraperStatus '[JSON] () ScraperStatus
type AddWithForm = Summary "Add with FormUrlEncoded to corpus endpoint"
:> "corpus"
:> Capture "corpus_id" CorpusId
:> "add"
:> "form"
:> ReqBody '[FormUrlEncoded] WithForm
:> "async"
:> AddAPI ()
:> AsyncJobsAPI2 ScraperStatus '[FormUrlEncoded] WithForm ScraperStatus
------------------------------------------------------------------------
-- TODO WithQuery also has a corpus id
......
......@@ -3,6 +3,7 @@ flags: {}
extra-package-dbs: []
packages:
- .
#- 'deps/servant-job'
docker:
enable: false
......@@ -35,9 +36,10 @@ extra-deps:
#
- git: https://gitlab.iscpif.fr/gargantext/patches-class
commit: 746b4ce0af8f9e600d555ad7e5b2973a940cdad9
#- git: https://github.com/delanoe/servant-job.git
- git: https://github.com/np/servant-job.git
commit: 4016c76398a56e1a352a45b3ee9d698dd0dd2597
- git: https://github.com/delanoe/servant-job.git
commit: 7a7b7100e6d132adb4c11b25b2128e6309690ac0
#- git: https://github.com/np/servant-job.git
# commit: 4016c76398a56e1a352a45b3ee9d698dd0dd2597
- git: https://gitlab.iscpif.fr/gargantext/clustering-louvain.git
commit: e5814cbfa71f43b0a453efb65f476240d7d51a53
- git: https://github.com/np/patches-map
......
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