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
177
Issues
177
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
fbf08f20
Commit
fbf08f20
authored
Jun 04, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] Upload/new ToSchemas.
parent
e58d0f2e
Pipeline
#431
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
New.hs
src/Gargantext/API/Corpus/New.hs
+5
-1
Upload.hs
src/Gargantext/API/Upload.hs
+2
-10
No files found.
src/Gargantext/API/Corpus/New.hs
View file @
fbf08f20
...
...
@@ -55,7 +55,11 @@ instance Arbitrary Query where
,
fs
<-
map
(
map
hash
)
[[
"a"
,
"b"
],
[
"c"
,
"d"
]]
]
instance
ToSchema
Query
instance
ToSchema
Query
where
declareNamedSchema
=
genericDeclareNamedSchema
defaultSchemaOptions
{
fieldLabelModifier
=
\
fieldLabel
->
drop
6
fieldLabel
}
type
Api
=
Summary
"New Corpus endpoint"
...
...
src/Gargantext/API/Upload.hs
View file @
fbf08f20
...
...
@@ -27,11 +27,8 @@ module Gargantext.API.Upload
where
import
Control.Lens
((
.~
),
(
?~
))
import
qualified
Data.Text
as
Text
import
GHC.Generics
(
Generic
)
import
Gargantext.Prelude
import
Data.Text
(
Text
)
import
Data.Aeson
import
Data.Monoid
import
Servant
import
Servant.Multipart
...
...
@@ -86,14 +83,9 @@ instance HasMock (MultipartForm Mem (MultipartData Mem) :> sub) context where
mock _ _ = undefined
-}
data
Upload
=
Upload
{
up
::
[
Text
]
}
deriving
(
Generic
)
instance
ToJSON
Upload
type
Hash
=
Text
type
ApiUpload
=
MultipartForm
Mem
(
MultipartData
Mem
)
:>
Post
'[
J
SON
]
Hash
type
ApiUpload
=
MultipartForm
Mem
(
MultipartData
Mem
)
:>
Post
'[
J
SON
]
[
Hash
]
-- MultipartData consists in textual inputs,
-- accessible through its "inputs" field, as well
-- as files, accessible through its "files" field.
...
...
@@ -117,7 +109,7 @@ upload multipartData = do
-- is <- inputs multipartData
--}
pure
$
hash
$
Text
.
concat
$
map
cs
is
pure
$
map
(
hash
.
cs
)
is
-------------------------------------------------------------------------------
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