mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 17:45:56 +08:00
Merge pull request #327 from coralproject/error_translation_key
Error translation key
This commit is contained in:
@@ -16,7 +16,7 @@ export const checkLogin = () => dispatch => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
dispatch(checkLoginFailure(`${error.message}`));
|
||||
dispatch(checkLoginFailure(`${error.translation_key}`));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ export const submitUser = () => (dispatch, getState) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
dispatch(installFailure(`${error.message}`));
|
||||
dispatch(installFailure(`${error.translation_key}`));
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -104,6 +104,6 @@ export const checkInstall = next => dispatch => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
dispatch(checkInstallFailure(`${error.message}`));
|
||||
dispatch(checkInstallFailure(`${error.translation_key}`));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ export const fetchSignUp = (formData, redirectUri) => (dispatch) => {
|
||||
dispatch(signUpSuccess(user));
|
||||
})
|
||||
.catch(error => {
|
||||
dispatch(signUpFailure(lang.t(`error.${error.translation_key}`)));
|
||||
dispatch(signUpFailure(lang.t(`error.${error.message}`)));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ export const checkLogin = () => dispatch => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
dispatch(checkLoginFailure(`${error.message}`));
|
||||
dispatch(checkLoginFailure(`${error.translation_key}`));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class SuspendedAccount extends Component {
|
||||
editName(username)
|
||||
.then(() => location.reload())
|
||||
.catch((error) => {
|
||||
this.setState({alert: lang.t(`error.${error.message}`)});
|
||||
this.setState({alert: lang.t(`error.${error.translation_key}`)});
|
||||
});
|
||||
} else {
|
||||
this.setState({alert: lang.t('editName.error')});
|
||||
|
||||
@@ -136,7 +136,7 @@ router.post('/', (req, res, next) => {
|
||||
res.status(201).json(user);
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
.catch((err) => {
|
||||
next(err);
|
||||
});
|
||||
});
|
||||
@@ -163,7 +163,6 @@ router.post('/:user_id/actions', authorization.needed(), (req, res, next) => {
|
||||
res.status(201).json(action);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('Error', err);
|
||||
next(err);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user