1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

reset password toast (#3935)

This commit is contained in:
Michael An
2019-07-31 14:43:11 +08:00
committed by Daniel Pan
parent 2b614b3324
commit 987f19bc00

View File

@@ -56,12 +56,15 @@ class UserItem extends React.Component {
toggleResetPW = () => {
const email = this.props.user.email;
toaster.success(gettext('Resetting user\'s password, please wait for a moment.'));
seafileAPI.resetOrgUserPassword(orgID, email).then(res => {
let msg;
msg = gettext('Successfully reset password to %(passwd)s for user %(user)s.');
msg = msg.replace('%(passwd)s', res.data.new_password);
msg = msg.replace('%(user)s', email);
toaster.success(msg);
toaster.success(msg, {
duration: 15
});
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);