From cb88409727cd231fe9cb9a042e89b10ae51216ba Mon Sep 17 00:00:00 2001 From: Andrean <88448470+QkoSad@users.noreply.github.com> Date: Mon, 8 May 2023 17:06:27 +0000 Subject: [PATCH] Update ProfileForm.js --- .../src/components/profile-forms/ProfileForm.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/client/src/components/profile-forms/ProfileForm.js b/client/src/components/profile-forms/ProfileForm.js index 9189d18..55b8358 100644 --- a/client/src/components/profile-forms/ProfileForm.js +++ b/client/src/components/profile-forms/ProfileForm.js @@ -4,11 +4,6 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createProfile, getCurrentProfile } from '../../actions/profile'; -/* - NOTE: declare initialState outside of component - so that it doesn't trigger a useEffect - we can then safely use this to construct our profileData - */ const initialState = { company: '', website: '', @@ -78,16 +73,11 @@ const ProfileForm = ({ setFormData({ ...formData, [e.target.name]: e.target.value }); const onSubmit = (e) => { -<<<<<<< HEAD const editing = profile ? true : false; e.preventDefault(); createProfile(formData, editing).then(() => { if (!editing) navigate('/dashboard'); }); -======= - e.preventDefault(); - createProfile(formData, navigate, profile ? true : false); ->>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb }; return ( @@ -281,8 +271,5 @@ const mapStateToProps = (state) => ({ export default connect(mapStateToProps, { createProfile, getCurrentProfile })( ProfileForm -<<<<<<< HEAD ); -======= -); ->>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb +