actionFullRegister.js 393 B

1234567891011
  1. import { actionReg } from "./actionReg";
  2. import { actionFullLogin } from "./actionFullLogin";
  3. export const actionFullRegister = (login, password) => async(dispatch) => {
  4. let result = await dispatch(actionReg(login, password))
  5. if(result?.data?.createUser !== null) {
  6. dispatch(actionFullLogin(login, password))
  7. } else {
  8. alert('Such a user already exists!')
  9. };
  10. };