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
200
Issues
200
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
e6b501f4
Commit
e6b501f4
authored
Jun 04, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Upload route, send a hash back (needs to store files).
parent
4d1470d0
Pipeline
#430
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Upload.hs
src/Gargantext/API/Upload.hs
+5
-2
test.txt
src/Gargantext/API/test.txt
+0
-1
No files found.
src/Gargantext/API/Upload.hs
View file @
e6b501f4
...
@@ -46,6 +46,7 @@ import Gargantext.API.Types
...
@@ -46,6 +46,7 @@ import Gargantext.API.Types
--import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
--import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
import
Data.Swagger
import
Data.Swagger
import
Gargantext.API.Ngrams
(
TODO
)
import
Gargantext.API.Ngrams
(
TODO
)
import
Gargantext.Prelude.Utils
(
hash
)
-- | Upload files
-- | Upload files
-- TODO Is it possible to adapt the function according to iValue input ?
-- TODO Is it possible to adapt the function according to iValue input ?
...
@@ -90,7 +91,9 @@ data Upload = Upload { up :: [Text] }
...
@@ -90,7 +91,9 @@ data Upload = Upload { up :: [Text] }
instance
ToJSON
Upload
instance
ToJSON
Upload
type
ApiUpload
=
MultipartForm
Mem
(
MultipartData
Mem
)
:>
Post
'[
J
SON
]
Text
type
Hash
=
Text
type
ApiUpload
=
MultipartForm
Mem
(
MultipartData
Mem
)
:>
Post
'[
J
SON
]
Hash
-- MultipartData consists in textual inputs,
-- MultipartData consists in textual inputs,
-- accessible through its "inputs" field, as well
-- accessible through its "inputs" field, as well
-- as files, accessible through its "files" field.
-- as files, accessible through its "files" field.
...
@@ -114,7 +117,7 @@ upload multipartData = do
...
@@ -114,7 +117,7 @@ upload multipartData = do
-- is <- inputs multipartData
-- is <- inputs multipartData
--}
--}
pure
$
Text
.
concat
$
map
cs
is
pure
$
hash
$
Text
.
concat
$
map
cs
is
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
src/Gargantext/API/test.txt
deleted
100644 → 0
View file @
4d1470d0
mercredi 15 mai 2019, 07:54:33 (UTC+0200)
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