open group page after groupd is created

This commit is contained in:
Maren Süwer
2019-01-22 10:53:15 +01:00
parent 2b782b1aca
commit e1a889143c
2 changed files with 5 additions and 4 deletions

View File

@@ -68,11 +68,13 @@ class AddGroup extends React.Component<Props, State> {
});
});
};
groupCreated = () => {
this.props.history.push("/groups");
groupCreated = (group: Group) => {
this.props.history.push("/group/" + group.name);
};
createGroup = (group: Group) => {
this.props.createGroup(this.props.createLink, group, this.groupCreated);
this.props.createGroup(this.props.createLink, group, () =>
this.groupCreated(group)
);
};
}

View File

@@ -35,7 +35,6 @@ class AddUser extends React.Component<Props> {
userCreated = (user: User) => {
const { history } = this.props;
console.log(user);
history.push("/user/" + user.name);
};