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
144
Issues
144
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
a74ea59d
Commit
a74ea59d
authored
Dec 02, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return Maybe (node ID) upon creating a subcorpus
parent
f785e149
Pipeline
#7070
canceled with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Subcorpus.hs
src/Gargantext/API/Node/Corpus/Subcorpus.hs
+3
-3
Corpus.hs
src/Gargantext/API/Routes/Named/Corpus.hs
+2
-2
No files found.
src/Gargantext/API/Node/Corpus/Subcorpus.hs
View file @
a74ea59d
...
@@ -22,11 +22,11 @@ makeSubcorpus :: ( HasNodeStoryEnv env
...
@@ -22,11 +22,11 @@ makeSubcorpus :: ( HasNodeStoryEnv env
->
MakeSubcorpusAPI
(
AsServerT
m
)
->
MakeSubcorpusAPI
(
AsServerT
m
)
makeSubcorpus
user
=
MakeSubcorpusAPI
$
\
corpusId
params
->
do
makeSubcorpus
user
=
MakeSubcorpusAPI
$
\
corpusId
params
->
do
case
parseQuery
(
RawQuery
$
_subcorpusParams_query
params
)
of
case
parseQuery
(
RawQuery
$
_subcorpusParams_query
params
)
of
Left
_
->
return
False
Left
_
->
return
Nothing
Right
q
->
do
Right
q
->
do
_
<-
makeSubcorpusFromQuery
subcorpusId
<-
makeSubcorpusFromQuery
(
UserDBId
user
)
(
UserDBId
user
)
corpusId
corpusId
q
q
(
_subcorpusParams_reuseParentList
params
)
(
_subcorpusParams_reuseParentList
params
)
return
True
return
$
Just
subcorpusId
src/Gargantext/API/Routes/Named/Corpus.hs
View file @
a74ea59d
...
@@ -32,7 +32,7 @@ import Gargantext.API.Worker (WorkerAPI)
...
@@ -32,7 +32,7 @@ import Gargantext.API.Worker (WorkerAPI)
import
Gargantext.Core.Text.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Core.Text.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Prelude
(
Bool
)
import
Gargantext.Prelude
(
Bool
,
Maybe
)
import
Servant
import
Servant
--------------------------------------------------
--------------------------------------------------
...
@@ -68,7 +68,7 @@ newtype MakeSubcorpusAPI mode = MakeSubcorpusAPI
...
@@ -68,7 +68,7 @@ newtype MakeSubcorpusAPI mode = MakeSubcorpusAPI
:>
Capture
"corpus_id"
CorpusId
:>
Capture
"corpus_id"
CorpusId
:>
"subcorpus"
:>
"subcorpus"
:>
ReqBody
'[
J
SON
]
SubcorpusParams
:>
ReqBody
'[
J
SON
]
SubcorpusParams
:>
Post
'[
J
SON
]
Bool
-- was request
successful
:>
Post
'[
J
SON
]
(
Maybe
NodeId
)
-- new subcorpus ID, if
successful
}
deriving
Generic
}
deriving
Generic
data
SubcorpusParams
=
SubcorpusParams
data
SubcorpusParams
=
SubcorpusParams
...
...
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