Commit f882428c authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] updateUsers pwd

parent 63f76792
Pipeline #1262 failed with stage
......@@ -51,6 +51,7 @@ instance Arbitrary ShareNodeParams where
]
------------------------------------------------------------------------
-- TODO permission
-- TODO refactor userId which is used twice
api :: HasNodeError err
=> NodeId
-> ShareNodeParams
......@@ -66,7 +67,7 @@ api nId (ShareTeamParams user') = do
_ <- newUsers [user']
pure u
fromIntegral <$> DB.shareNodeWith (ShareNodeWith_User NodeFolderShared (UserName user)) nId
fromIntegral <$> DB.shareNodeWith (ShareNodeWith_User NodeFolderShared (UserName user)) nId
api nId2 (SharePublicParams nId1) =
fromIntegral <$> DB.shareNodeWith (ShareNodeWith_Node NodeFolderPublic nId1) nId2
......
......@@ -70,12 +70,17 @@ newUsers' address us = do
_ <- liftBase $ mapM (mail Invitation address) us
pure r
------------------------------------------------------------------------
data SendEmail = SendEmail Bool
updateUser :: HasNodeError err
=> Text -> NewUser GargPassword -> Cmd err Int64
updateUser address u = do
=> SendEmail -> Text -> NewUser GargPassword -> Cmd err Int64
updateUser (SendEmail send) address u = do
u' <- liftBase $ toUserHash u
n <- updateUserDB $ toUserWrite u'
_ <- liftBase $ mail Update address u
_ <- case send of
True -> liftBase $ mail Update address u
False -> pure ()
pure n
------------------------------------------------------------------------
......
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