diff --git a/client/src/actions/experience.ts b/client/src/actions/experience.ts index f52fc3f..8e20eeb 100644 --- a/client/src/actions/experience.ts +++ b/client/src/actions/experience.ts @@ -23,12 +23,10 @@ export const getExperiencesTalent = export const ExperienceUpdate = (id, ExperienceData) => async (dispatch) => { try { - // dispatch({ type: 'START_LOADING' }); const { data } = await updateExperience(id, ExperienceData); dispatch({ type: 'UPDATE_TALENT_EXPERIENCE', payload: data }); - // dispatch({ type: 'END_LOADING' }); } catch (error) { - console.log(error.message); + console.log(error); } }; @@ -39,7 +37,7 @@ export const ExperienceDelete = (id) => async (dispatch) => { dispatch({ type: 'DELETE_TALENT_EXPERIENCE', payload: id }); // setLoading(false); } catch (error) { - console.log(error.message); + console.log(error); } }; @@ -51,6 +49,6 @@ export const ExperienceCreate = dispatch({ type: 'CREATE_TALENT_EXPERIENCE', payload: data }); setLoading(false); } catch (error) { - console.log(error.message); + console.log(error); } }; diff --git a/client/src/components/Modal/AddCertificateModal.tsx b/client/src/components/Modal/AddCertificateModal.tsx index 74ef240..f38a7e4 100644 --- a/client/src/components/Modal/AddCertificateModal.tsx +++ b/client/src/components/Modal/AddCertificateModal.tsx @@ -1,59 +1,59 @@ -import { modalProps } from "./interfaces/modaInterface.ts"; -import TButton from "../Button/TButton.tsx"; -import "./styles/AddProjectModal.css"; -import { useContext } from "react"; -import { TalentContext } from "../../pages/Talent/Talent.tsx"; -import { createExperience } from "../../api/experience.ts"; +import { modalProps } from './interfaces/modaInterface.ts'; +import TButton from '../Button/TButton.tsx'; +import './styles/AddProjectModal.css'; +import { useContext } from 'react'; +import { TalentContext } from '../../pages/Talent/Talent.tsx'; +import { createCertification } from '../../api/certifications.ts'; function AddCertificateModal({ show, setShow }: modalProps) { - const modalStyle = show ? "showModal" : ""; - const tp = useContext(TalentContext); + const modalStyle = show ? 'showModal' : ''; + const tp = useContext(TalentContext); - const { talentProfile } = localStorage; - const tal = talentProfile ? JSON.parse(talentProfile as string).talent : {}; - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - const formData = new FormData(e.target as HTMLFormElement); - formData.append("talentId", tal._id); - const data = Object.fromEntries(formData); + const { talentProfile } = localStorage; + const tal = talentProfile ? JSON.parse(talentProfile as string).talent : {}; + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + const formData = new FormData(e.target as HTMLFormElement); + formData.append('talentId', tal._id); + const data = Object.fromEntries(formData); - await createExperience(data); - tp.setRefresh(!tp.refresh); - const formElement = e.target as HTMLFormElement; - formElement.reset(); - setShow(false); - }; + await createCertification(data); + tp.setRefresh(!tp.refresh); + const formElement = e.target as HTMLFormElement; + formElement.reset(); + setShow(false); + }; - return ( -
-
-
-

Add Certification Modal

{" "} - setShow(false)} /> -
-
-
-
- - -
-
- - -
+ return ( +
+
+
+

Add Certification Modal

{' '} + setShow(false)} /> +
+
+ +
+ + +
+
+ + +
-
- -