Commit 9585dc78 by Torkel Ödegaard

added the UserWasRemoved flag to make api aware of what happened to return correct message to UI

parent 5b5cb662
...@@ -125,5 +125,9 @@ func removeOrgUserHelper(cmd *m.RemoveOrgUserCommand) Response { ...@@ -125,5 +125,9 @@ func removeOrgUserHelper(cmd *m.RemoveOrgUserCommand) Response {
return Error(500, "Failed to remove user from organization", err) return Error(500, "Failed to remove user from organization", err)
} }
if cmd.UserWasRemoved {
return Success("User deleted")
}
return Success("User removed from organization") return Success("User removed from organization")
} }
...@@ -75,6 +75,7 @@ type RemoveOrgUserCommand struct { ...@@ -75,6 +75,7 @@ type RemoveOrgUserCommand struct {
UserId int64 UserId int64
OrgId int64 OrgId int64
ShouldDeleteOrphanedUser bool ShouldDeleteOrphanedUser bool
UserWasRemoved bool
} }
type AddOrgUserCommand struct { type AddOrgUserCommand struct {
......
...@@ -194,6 +194,8 @@ func RemoveOrgUser(cmd *m.RemoveOrgUserCommand) error { ...@@ -194,6 +194,8 @@ func RemoveOrgUser(cmd *m.RemoveOrgUserCommand) error {
if err := deleteUserInTransaction(sess, &m.DeleteUserCommand{UserId: user.Id}); err != nil { if err := deleteUserInTransaction(sess, &m.DeleteUserCommand{UserId: user.Id}); err != nil {
return err return err
} }
cmd.UserWasRemoved = true
} }
return nil return nil
......
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