fetch user again after modification

This commit is contained in:
Maren Süwer
2018-11-05 13:14:52 +01:00
parent bbfea08b8e
commit ff1dc25c5c
3 changed files with 53 additions and 13 deletions

View File

@@ -15,7 +15,7 @@ import EditUser from "./EditUser";
import type { User } from "@scm-manager/ui-types";
import type { History } from "history";
import {
fetchUser,
fetchUserByName,
deleteUser,
getUserByName,
isFetchUserPending,
@@ -37,7 +37,7 @@ type Props = {
// dispatcher functions
deleteUser: (user: User, callback?: () => void) => void,
fetchUser: (string, string) => void,
fetchUserByName: (string, string) => void,
// context objects
t: string => string,
@@ -47,7 +47,7 @@ type Props = {
class SingleUser extends React.Component<Props> {
componentDidMount() {
this.props.fetchUser(this.props.usersLink, this.props.name);
this.props.fetchUserByName(this.props.usersLink, this.props.name);
}
userDeleted = () => {
@@ -138,8 +138,8 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = dispatch => {
return {
fetchUser: (link: string, name: string) => {
dispatch(fetchUser(link, name));
fetchUserByName: (link: string, name: string) => {
dispatch(fetchUserByName(link, name));
},
deleteUser: (user: User, callback?: () => void) => {
dispatch(deleteUser(user, callback));