Commit 6fbc118f authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Invitation script

parent c4fe12d3
Pipeline #3177 passed with stage
in 91 minutes and 56 seconds
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* [BACK][UPGRADE] ./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql * [BACK][UPGRADE] ./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql
* [BACK][ADMIN] upgrade script, test ok * [BACK][ADMIN] upgrade script, test ok
* [BACK][FIX][API] IsTex * [BACK][FIX][API] IsTex
* [BACK][ADM] Invitation script
## Version 0.0.6.1 ## Version 0.0.6.1
* [BACK][FEAT] Spacy Server connection for French (and others) languages * [BACK][FEAT] Spacy Server connection for French (and others) languages
......
...@@ -29,23 +29,25 @@ import Gargantext.Database.Query.Table.Node (getOrMkList) ...@@ -29,23 +29,25 @@ import Gargantext.Database.Query.Table.Node (getOrMkList)
import Gargantext.Database.Query.Table.User (insertNewUsers, ) import Gargantext.Database.Query.Table.User (insertNewUsers, )
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Prelude.Config (GargConfig(..), readConfig) import Gargantext.Prelude.Config (GargConfig(..), readConfig)
import Prelude (getLine) import Prelude (getLine, read)
import System.Environment (getArgs) import System.Environment (getArgs)
import Gargantext.Database.Action.User.New (newUsers) import Gargantext.Database.Action.User.New (newUsers)
import Gargantext.Core.Types.Individu (User(..))
import qualified Gargantext.API.Node.Share as Share
main :: IO () main :: IO ()
main = do main = do
params@[iniPath,email] <- getArgs params@[iniPath,user,node_id,email] <- getArgs
_ <- if length params /= 2 _ <- if length params /= 4
then panic "USAGE: ./gargantext-init gargantext.ini student@university.edu" then panic "USAGE: ./gargantext-init gargantext.ini username node_id student@university.edu"
else pure () else pure ()
cfg <- readConfig iniPath cfg <- readConfig iniPath
let createUsers :: CmdR GargError Int64 let invite :: CmdR GargError Int
createUsers = newUsers [cs email] invite = Share.api (UserName $ cs user) (NodeId $ (read node_id :: Int)) (Share.ShareTeamParams $ cs email)
withDevEnv iniPath $ \env -> do withDevEnv iniPath $ \env -> do
_ <- runCmdDev env createUsers _ <- runCmdDev env invite
pure () pure ()
...@@ -33,6 +33,7 @@ library ...@@ -33,6 +33,7 @@ library
Gargantext.API.Dev Gargantext.API.Dev
Gargantext.API.HashedResponse Gargantext.API.HashedResponse
Gargantext.API.Node Gargantext.API.Node
Gargantext.API.Node.Share
Gargantext.API.Node.File Gargantext.API.Node.File
Gargantext.API.Ngrams Gargantext.API.Ngrams
Gargantext.API.Ngrams.Tools Gargantext.API.Ngrams.Tools
...@@ -139,7 +140,6 @@ library ...@@ -139,7 +140,6 @@ library
Gargantext.API.Node.FrameCalcUpload Gargantext.API.Node.FrameCalcUpload
Gargantext.API.Node.Get Gargantext.API.Node.Get
Gargantext.API.Node.New Gargantext.API.Node.New
Gargantext.API.Node.Share
Gargantext.API.Node.Types Gargantext.API.Node.Types
Gargantext.API.Node.Update Gargantext.API.Node.Update
Gargantext.API.Public Gargantext.API.Public
......
...@@ -57,6 +57,7 @@ library: ...@@ -57,6 +57,7 @@ library:
- Gargantext.API.Dev - Gargantext.API.Dev
- Gargantext.API.HashedResponse - Gargantext.API.HashedResponse
- Gargantext.API.Node - Gargantext.API.Node
- Gargantext.API.Node.Share
- Gargantext.API.Node.File - Gargantext.API.Node.File
- Gargantext.API.Ngrams - Gargantext.API.Ngrams
- Gargantext.API.Ngrams.Tools - Gargantext.API.Ngrams.Tools
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment