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 @@
* [BACK][UPGRADE] ./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql
* [BACK][ADMIN] upgrade script, test ok
* [BACK][FIX][API] IsTex
* [BACK][ADM] Invitation script
## Version 0.0.6.1
* [BACK][FEAT] Spacy Server connection for French (and others) languages
......
......@@ -29,23 +29,25 @@ import Gargantext.Database.Query.Table.Node (getOrMkList)
import Gargantext.Database.Query.Table.User (insertNewUsers, )
import Gargantext.Prelude
import Gargantext.Prelude.Config (GargConfig(..), readConfig)
import Prelude (getLine)
import Prelude (getLine, read)
import System.Environment (getArgs)
import Gargantext.Database.Action.User.New (newUsers)
import Gargantext.Core.Types.Individu (User(..))
import qualified Gargantext.API.Node.Share as Share
main :: IO ()
main = do
params@[iniPath,email] <- getArgs
params@[iniPath,user,node_id,email] <- getArgs
_ <- if length params /= 2
then panic "USAGE: ./gargantext-init gargantext.ini student@university.edu"
_ <- if length params /= 4
then panic "USAGE: ./gargantext-init gargantext.ini username node_id student@university.edu"
else pure ()
cfg <- readConfig iniPath
let createUsers :: CmdR GargError Int64
createUsers = newUsers [cs email]
let invite :: CmdR GargError Int
invite = Share.api (UserName $ cs user) (NodeId $ (read node_id :: Int)) (Share.ShareTeamParams $ cs email)
withDevEnv iniPath $ \env -> do
_ <- runCmdDev env createUsers
_ <- runCmdDev env invite
pure ()
......@@ -33,6 +33,7 @@ library
Gargantext.API.Dev
Gargantext.API.HashedResponse
Gargantext.API.Node
Gargantext.API.Node.Share
Gargantext.API.Node.File
Gargantext.API.Ngrams
Gargantext.API.Ngrams.Tools
......@@ -139,7 +140,6 @@ library
Gargantext.API.Node.FrameCalcUpload
Gargantext.API.Node.Get
Gargantext.API.Node.New
Gargantext.API.Node.Share
Gargantext.API.Node.Types
Gargantext.API.Node.Update
Gargantext.API.Public
......
......@@ -57,6 +57,7 @@ library:
- Gargantext.API.Dev
- Gargantext.API.HashedResponse
- Gargantext.API.Node
- Gargantext.API.Node.Share
- Gargantext.API.Node.File
- Gargantext.API.Ngrams
- 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