Advertisement
Fahim_7861

Action

Jul 16th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import React from "react";
  2. import { AUTH_INFO_LOAD } from "../../constants/types";
  3. import Sulov from "../../Sulov";
  4. import { sulovBaseUrl } from "../../sulovBaseUrl";
  5. const axios = require("axios");
  6.  
  7. export const authAction = (data) => async (dispatch) => {
  8.  
  9.  
  10.  
  11. try {
  12.  
  13. const url = `${sulovBaseUrl}/user/signupin`;
  14.  
  15. const res = await axios.post(url, { ...data });
  16.  
  17.  
  18. return dispatch({
  19. type: AUTH_INFO_LOAD,
  20. payload: { ...res.data.data },
  21. });
  22.  
  23.  
  24.  
  25. } catch (err) {
  26. console.log(err);
  27. }
  28. };
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement