Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
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
Changes
2
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
--import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
import
Data.Swagger
import
Gargantext.API.Ngrams
(
TODO
)
import
Gargantext.Prelude.Utils
(
hash
)
-- | Upload files
-- TODO Is it possible to adapt the function according to iValue input ?
...
...
@@ -90,7 +91,9 @@ data Upload = Upload { up :: [Text] }
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,
-- accessible through its "inputs" field, as well
-- as files, accessible through its "files" field.
...
...
@@ -114,7 +117,7 @@ upload multipartData = do
-- 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