Web: People: fixed redirect after editing user via direct link

This commit is contained in:
Artem Tarasov 2020-10-05 12:45:16 +03:00
parent a92365df79
commit 0836a55d68
3 changed files with 7 additions and 6 deletions

View File

@ -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) => {

View File

@ -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);

View File

@ -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;