actionFullRegister.js 442 B

1234567891011
  1. import { actionRegister } from "./actionRegister";
  2. import { actionFullLogin } from "./actionFullLogin";
  3. export const actionFullRegister = (login, password) => async (dispatch) => {
  4. let result = await dispatch(actionRegister(login, password));
  5. if (result?.data?.createUser !== null) {
  6. await dispatch(actionFullLogin(login, password));
  7. } else {
  8. alert("Такой пользователь уже есть!");
  9. }
  10. };