Web: People: fixed redirect after editing user via direct link
This commit is contained in:
parent
a92365df79
commit
0836a55d68
@ -358,6 +358,7 @@ class UpdateUserForm extends React.Component {
|
||||
response.max +
|
||||
"?_=" +
|
||||
Math.floor(Math.random() * Math.floor(10000));
|
||||
|
||||
toastr.success(this.props.t("ChangesSavedSuccessfully"));
|
||||
this.setState({ isLoading: false });
|
||||
this.setState(stateCopy);
|
||||
@ -366,8 +367,10 @@ class UpdateUserForm extends React.Component {
|
||||
toastr.error(error);
|
||||
this.setState({ isLoading: false });
|
||||
})
|
||||
.then(() => this.props.updateProfile(this.props.profile))
|
||||
.then(() => this.props.fetchProfile(this.state.profile.id));
|
||||
.then(() => {
|
||||
this.props.updateProfile(this.props.profile);
|
||||
this.setState({ isLoading: false });
|
||||
});
|
||||
} else {
|
||||
deleteAvatar(this.state.profile.id)
|
||||
.then((response) => {
|
||||
|
@ -251,7 +251,7 @@ export function updateProfileInUsers(updatedProfile) {
|
||||
|
||||
if (!users) {
|
||||
const { filter } = people;
|
||||
return fetchPeople(filter, dispatch);
|
||||
return updateUserList(dispatch);
|
||||
}
|
||||
|
||||
const oldProfile = getUserByUserName(users, userName);
|
||||
|
@ -72,9 +72,7 @@ export function createProfile(profile) {
|
||||
}
|
||||
|
||||
export function updateProfile(profile) {
|
||||
return (dispatch, getState) => {
|
||||
const { people } = getState();
|
||||
const { filter } = people;
|
||||
return (dispatch) => {
|
||||
const member = employeeWrapperToMemberModel(profile);
|
||||
let result;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user