Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
e1305265
Commit
e1305265
authored
Jan 15, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][FIX] urlencoded
parent
e645b9dc
Pipeline
#689
failed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
API.hs
src/Gargantext/API.hs
+2
-3
New.hs
src/Gargantext/API/Corpus/New.hs
+6
-5
No files found.
src/Gargantext/API.hs
View file @
e1305265
...
@@ -383,10 +383,9 @@ addWithFile cid i f =
...
@@ -383,10 +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
=
addWithForm
cid
f
=
serveJobsAPI
$
serveJobsAPI
$
JobFunction
(
\
i
log
->
New
.
addToCorpusWithForm
cid
i
(
liftIO
.
log
))
JobFunction
(
\
_i
log
->
New
.
addToCorpusWithForm
cid
f
(
liftIO
.
log
))
serverStatic
::
Server
(
Get
'[
H
TML
]
Html
)
serverStatic
::
Server
(
Get
'[
H
TML
]
Html
)
serverStatic
=
$
(
do
serverStatic
=
$
(
do
...
...
src/Gargantext/API/Corpus/New.hs
View file @
e1305265
...
@@ -24,6 +24,7 @@ New corpus means either:
...
@@ -24,6 +24,7 @@ New corpus means either:
module
Gargantext.API.Corpus.New
module
Gargantext.API.Corpus.New
where
where
import
Web.FormUrlEncoded
(
FromForm
)
import
Data.Either
import
Data.Either
import
Control.Monad.IO.Class
(
liftIO
)
import
Control.Monad.IO.Class
(
liftIO
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
...
@@ -152,18 +153,18 @@ instance FromJSON WithQuery where
...
@@ -152,18 +153,18 @@ instance FromJSON WithQuery where
parseJSON
=
genericParseJSON
$
jsonOptions
"_wq_"
parseJSON
=
genericParseJSON
$
jsonOptions
"_wq_"
instance
ToSchema
WithQuery
instance
ToSchema
WithQuery
-------------------------------------------------------
data
WithForm
=
WithForm
data
WithForm
=
WithForm
{
_wf_filetype
::
!
FileType
{
_wf_filetype
::
!
FileType
,
_wf_data
::
!
Text
,
_wf_data
::
!
Text
}
deriving
Generic
}
deriving
(
Eq
,
Show
,
Generic
)
makeLenses
''
W
ithForm
makeLenses
''
W
ithForm
instance
FromJSON
WithForm
where
instance
FromJSON
WithForm
where
parseJSON
=
genericParseJSON
$
jsonOptions
"_wf_"
parseJSON
=
genericParseJSON
$
jsonOptions
"_wf_"
instance
ToSchema
WithForm
instance
ToSchema
WithForm
instance
FromForm
WithForm
------------------------------------------------------------------------
------------------------------------------------------------------------
...
@@ -194,9 +195,9 @@ type AddWithForm = Summary "Add to corpus endpoint"
...
@@ -194,9 +195,9 @@ type AddWithForm = Summary "Add to corpus endpoint"
:>
Capture
"corpus_id"
CorpusId
:>
Capture
"corpus_id"
CorpusId
:>
"add"
:>
"add"
:>
"form"
:>
"form"
:>
ReqBody
'[
F
ormUrlEncoded
]
WithForm
:>
"async"
:>
"async"
:>
AddAPI
WithForm
:>
AddAPI
()
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO WithQuery also has a corpus id
-- TODO WithQuery also has a corpus id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment