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

[FIX] Async routes.

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