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
153
Issues
153
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
b85b523e
Commit
b85b523e
authored
Mar 02, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/475-dev-node-team-invite' into dev-merge
parents
331ffc70
d27f9ebd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
gargantext.cabal
gargantext.cabal
+1
-0
Members.hs
src/Gargantext/API/Members.hs
+26
-0
Routes.hs
src/Gargantext/API/Routes.hs
+6
-0
No files found.
gargantext.cabal
View file @
b85b523e
...
...
@@ -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
...
...
src/Gargantext/API/Members.hs
0 → 100644
View file @
b85b523e
module
Gargantext.API.Members
where
import
Gargantext.Prelude
import
Gargantext.API.Prelude
import
Servant
import
Data.Text
(
Text
)
import
Gargantext.API.Admin.EnvTypes
(
Env
)
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
m
<-
concatMapM
membersOf
teamNodeIds
pure
$
map
fst
m
src/Gargantext/API/Routes.hs
View file @
b85b523e
...
...
@@ -33,6 +33,7 @@ import Gargantext.API.Admin.EnvTypes (Env, GargJob(..))
import
Gargantext.API.Admin.FrontEnd
(
FrontEndAPI
)
import
Gargantext.API.Context
import
Gargantext.API.Count
(
CountAPI
,
count
,
Query
)
import
Gargantext.API.Members
(
MembersAPI
,
members
)
import
Gargantext.API.Job
(
jobLogInit
)
import
Gargantext.API.Ngrams
(
TableNgramsApi
,
apiNgramsTableDoc
)
import
Gargantext.API.Node
...
...
@@ -163,6 +164,9 @@ type GargPrivateAPI' =
:>
Capture
"tree_id"
NodeId
:>
TreeAPI
:<|>
"members"
:>
Summary
"Team node members"
:>
MembersAPI
-- :<|> New.Upload
:<|>
New
.
AddWithForm
-- :<|> New.AddWithFile
...
...
@@ -248,6 +252,8 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
:<|>
withAccess
(
Proxy
::
Proxy
TreeAPI
)
Proxy
uid
<$>
PathNode
<*>
treeAPI
:<|>
members
uid
-- TODO access
:<|>
addCorpusWithForm
(
RootId
(
NodeId
uid
))
-- :<|> addCorpusWithFile (RootId (NodeId uid))
...
...
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