Skip to content

Commit

Permalink
chore: cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingscliq committed Oct 13, 2024
1 parent 08ec223 commit f2ec0bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
3 changes: 0 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ function App() {
);
setExperiences(updatedExperiences);
setActiveTab("view");

console.log({ experiences });
},
[experiences]
);
Expand Down Expand Up @@ -108,7 +106,6 @@ function App() {
),
};

console.log({ experiences });
return (
<div className="App">
<h1>Resume Builder</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/components/User/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const User = () => {
const handleSubmit = (e) => {
e.preventDefault();
// handle form submission here
console.log(userInfo);

setIsOpen(false);
};

Expand Down
15 changes: 4 additions & 11 deletions src/components/education/EducationEditPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,30 @@ function EducationEditPage() {
const [error, setError] = useState(null);

useEffect(() => {
console.log("EducationEditPage mounted");
fetchEducations();
}, []);

const fetchEducations = async () => {
setIsLoading(true);
setError(null);
try {
console.log("Fetching educations...");
const response = await fetch("http://127.0.0.1:5000/resume/education", {
method: "GET",
headers: {
Accept: "application/json",
},
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}`);
}
Expand All @@ -56,7 +52,6 @@ function EducationEditPage() {
};

const handleSelectEducation = (education) => {
console.log("Selected education:", education);
setSelectedEducation(education);
setFormData(education);
};
Expand All @@ -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}`,
{
Expand All @@ -83,18 +77,17 @@ 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);
} else {
const errorText = await response.text();
console.error(
"Failed to update education. Server response:",
errorText,
errorText
);
setError(`Failed to update education. Server response: ${errorText}`);
}
Expand Down
5 changes: 1 addition & 4 deletions src/components/education/EducationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 :(");
});
};
Expand Down Expand Up @@ -95,8 +93,7 @@ const EducationForm = () => {
</label>
<label>
<h2>Logo</h2>
<Dropzone/>

<Dropzone />
</label>

<button onSubmit={handleSubmit}>Submit Education</button>
Expand Down
1 change: 0 additions & 1 deletion src/components/skills/AddSkillForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit f2ec0bd

Please sign in to comment.