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
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
Julien Moutinho
haskell-gargantext
Commits
d27f9ebd
Commit
d27f9ebd
authored
2 years ago
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] Team members API for autocomplete
parent
0b5b66ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
gargantext.cabal
gargantext.cabal
+1
-0
Members.hs
src/Gargantext/API/Members.hs
+9
-1
No files found.
gargantext.cabal
View file @
d27f9ebd
...
...
@@ -132,6 +132,7 @@ library
Gargantext.API.GraphQL.Utils
Gargantext.API.Job
Gargantext.API.Metrics
Gargantext.API.Members
Gargantext.API.Ngrams.List
Gargantext.API.Ngrams.List.Types
Gargantext.API.Ngrams.NgramsTree
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Members.hs
View file @
d27f9ebd
...
...
@@ -9,10 +9,18 @@ import Gargantext.Core.Types (UserId)
import
Gargantext.Database.Admin.Types.Node
(
NodeType
(
NodeTeam
))
import
Gargantext.Database.Query.Table.Node
(
getNodesIdWithType
)
import
Gargantext.Database.Action.Share
(
membersOf
)
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
Gargantext.Core.Mail.Types
(
HasMail
)
import
Control.Monad.Extra
(
concatMapM
)
type
MembersAPI
=
Get
'[
J
SON
]
[
Text
]
members
::
UserId
->
ServerT
MembersAPI
(
GargM
Env
GargError
)
members
_
=
do
getMembers
getMembers
::
(
HasConnectionPool
env
,
HasConfig
env
,
HasMail
env
)
=>
GargM
env
GargError
[
Text
]
getMembers
=
do
teamNodeIds
<-
getNodesIdWithType
NodeTeam
map
fst
$
concatMap
membersOf
teamNodeIds
m
<-
concatMapM
membersOf
teamNodeIds
pure
$
map
fst
m
This diff is collapsed.
Click to expand it.
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