uat
HOANGLAOTA 1 year ago
parent 11e3f9b596
commit 58c65da1f0
  1. 6
      src/_actions/users.js
  2. 2
      src/_containers/RegisterPage/CreateAccount/index.js

@ -36,8 +36,12 @@ function login(data, type = "", typeWeb) {
return (dispatch) => {
let url_call_api = "/login";
let method = "POST";
return apiCaller(url_call_api, method, data, null, false).then(
return apiCaller(url_call_api, method, data, null, false, configConstants.API_URL_SETEST, true, true).then(
async (data) => {
if(!data?.status) {
dispatch(alertActions.error({ 'message': typeof data?.msg === 'string' ? data?.msg : Object.values(data?.msg)?.join('\n'), 'screen': userConstants.SCREEN_LOGIN }));
return;
}
let user = data;
user.isLogin = true;
dispatch({

@ -60,7 +60,7 @@ const CreateAccount = () => {
if (res.status) {
dispatch(alertActions.success({ 'message': res?.msg, 'screen': userConstants.SCREEN_REGISTER }));
} else {
dispatch(alertActions.error({ 'message': Object.values(res?.msg)?.join('\n'), 'screen': userConstants.SCREEN_REGISTER, isShowPopup: true }));
dispatch(alertActions.error({ 'message': typeof res?.msg === 'string' ? res?.msg : Object.values(res?.msg)?.join('\n'), 'screen': userConstants.SCREEN_REGISTER, isShowPopup: true }));
}
} catch (err) {
dispatch(alertActions.error({ 'message': err, 'screen': userConstants.SCREEN_REGISTER, isShowPopup: true }));

Loading…
Cancel
Save