From f2ec0bd2d12bd26540676c60897f60b0b62554d7 Mon Sep 17 00:00:00 2001 From: Ajaezo Kingsley Date: Sun, 13 Oct 2024 16:56:24 -0500 Subject: [PATCH] chore: cleanups --- src/App.js | 3 --- src/components/User/page.jsx | 2 +- src/components/education/EducationEditPage.jsx | 15 ++++----------- src/components/education/EducationForm.jsx | 5 +---- src/components/skills/AddSkillForm.jsx | 1 - 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/App.js b/src/App.js index 9436493..bd235c0 100644 --- a/src/App.js +++ b/src/App.js @@ -41,8 +41,6 @@ function App() { ); setExperiences(updatedExperiences); setActiveTab("view"); - - console.log({ experiences }); }, [experiences] ); @@ -108,7 +106,6 @@ function App() { ), }; - console.log({ experiences }); return (

Resume Builder

diff --git a/src/components/User/page.jsx b/src/components/User/page.jsx index 20468dc..17b13dd 100644 --- a/src/components/User/page.jsx +++ b/src/components/User/page.jsx @@ -15,7 +15,7 @@ const User = () => { const handleSubmit = (e) => { e.preventDefault(); // handle form submission here - console.log(userInfo); + setIsOpen(false); }; diff --git a/src/components/education/EducationEditPage.jsx b/src/components/education/EducationEditPage.jsx index e6cb969..4e1aa2a 100644 --- a/src/components/education/EducationEditPage.jsx +++ b/src/components/education/EducationEditPage.jsx @@ -16,7 +16,6 @@ function EducationEditPage() { const [error, setError] = useState(null); useEffect(() => { - console.log("EducationEditPage mounted"); fetchEducations(); }, []); @@ -24,7 +23,6 @@ function EducationEditPage() { setIsLoading(true); setError(null); try { - console.log("Fetching educations..."); const response = await fetch("http://127.0.0.1:5000/resume/education", { method: "GET", headers: { @@ -32,18 +30,16 @@ function EducationEditPage() { }, mode: "cors", }); - console.log("Response status:", response.status); - console.log("Response headers:", response.headers); if (response.ok) { const data = await response.json(); - console.log("Fetched educations:", data); + setEducations(data); } else { const errorText = await response.text(); console.error( "Failed to fetch educations. Server response:", - errorText, + errorText ); setError(`Failed to fetch educations. Server response: ${errorText}`); } @@ -56,7 +52,6 @@ function EducationEditPage() { }; const handleSelectEducation = (education) => { - console.log("Selected education:", education); setSelectedEducation(education); setFormData(education); }; @@ -74,7 +69,6 @@ function EducationEditPage() { setIsLoading(true); setError(null); try { - console.log("Updating education:", formData); const response = await fetch( `http://127.0.0.1:5000/resume/education?index=${selectedEducation.id}`, { @@ -83,10 +77,9 @@ function EducationEditPage() { "Content-Type": "application/json", }, body: JSON.stringify(formData), - }, + } ); if (response.ok) { - console.log("Education updated successfully"); alert("Education updated successfully!"); await fetchEducations(); setSelectedEducation(null); @@ -94,7 +87,7 @@ function EducationEditPage() { const errorText = await response.text(); console.error( "Failed to update education. Server response:", - errorText, + errorText ); setError(`Failed to update education. Server response: ${errorText}`); } diff --git a/src/components/education/EducationForm.jsx b/src/components/education/EducationForm.jsx index 03174e0..9b9228d 100644 --- a/src/components/education/EducationForm.jsx +++ b/src/components/education/EducationForm.jsx @@ -32,11 +32,9 @@ const EducationForm = () => { }) .then((response) => response.json()) .then((data) => { - console.log(data); alert("Education successfully added!"); }) .catch((error) => { - console.log(error); alert("Error: Education not added :("); }); }; @@ -95,8 +93,7 @@ const EducationForm = () => { diff --git a/src/components/skills/AddSkillForm.jsx b/src/components/skills/AddSkillForm.jsx index 9030447..7dd876f 100644 --- a/src/components/skills/AddSkillForm.jsx +++ b/src/components/skills/AddSkillForm.jsx @@ -27,7 +27,6 @@ function AddSkillForm({ onSubmit }) { const result = await response.json(); if (response.ok) { - console.log("Skill added successfully"); onSubmit && onSubmit(); } else { console.error(`Error adding skill: ${result.message}`);