Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import firebase from 'firebase';
- import { toast } from 'react-toastify';
- import {
- CREATE_USER,
- UPDATE_FORM
- } from './ActionTypes';
- export const formUpdate = ({ prop, value }) => {
- return {
- type: UPDATE_FORM,
- payload: { prop, value }
- }
- }
- export const createProfile = ({ fName, lName, email, company, billingMethod, date }) => {
- // const { currentUser } = firebase.auth();
- return (dispatch) => {
- firebase.database().ref(`/profile`)
- .push({ fName, lName, email, company, billingMethod, date })
- .then(() => {
- dispatch({ type: CREATE_USER })
- })
- .then(() => {
- toast.info("User profile was created !", {
- position: toast.POSITION.BOTTOM_CENTER,
- autoClose: 1000
- });
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement