Skip to content

Removes the console expressions #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const mongoURI = "mongodb+srv://AyanProgrammer11:[email protected]
const connectToMongo = async () => {
// console.log("Function running")
try {
console.log("Inside try");

await mongoose.connect(mongoURI);
console.log("Connected to Mongo Successfully");

} catch(err) {
// console.log("Inside catch")
console.log("Failed to Connect");
Expand Down
2 changes: 1 addition & 1 deletion backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ app.use('/api/contact', require("./routes/contact"))


app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)

})
2 changes: 1 addition & 1 deletion src/Components/ContactUs.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const handleSubmit = async (e) => {
});
const json = await response.json();
setEmail(json.email);
console.log(json);


}
fetchUserEmail();
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const Login = (props) => {
body: JSON.stringify({email: credentials.email, password: credentials.password})
});
const json = await response.json();
console.log(json);

if(json.success) {
// Set the AuthToken to the Local Storage, So the user would not have to enter his/her credentials again and again when visiting the website
localStorage.setItem("token", json.authtoken);
console.log(localStorage.getItem("token"));
console.log(json.success)


// Navigate to the Root route of the application
// showAlert("Logged in Successfully!", "success");
showToast.success("Loggged in Successfully")
Expand Down
2 changes: 1 addition & 1 deletion src/Components/MyAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const closeAfterDeletion = useRef(null);
})
const json = await response.json();
localStorage.removeItem("token")
console.log(json);

closeAfterDeletion.current.click();
setIng("Delete Account")
Navigate("/signup");
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const {showToast} = props;
body: JSON.stringify({email: feedback.email, title: feedback.title, message: feedback.message})
});
const json = await response.json();
console.log(json);

if(json.success) {
// If feedback went successful then close the modal by using the "useRef" hook
closeModal.current.click();
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Notes = (props) => {
setNote({...note, [event.target.name]: event.target.value})
}
const handleClick = (e) => {
console.log("Updating the note", note);

refClose.current.click();
showToast.promise(editNote(note.id, note.etitle, note.edescription, note.etag), {
loading: "Updating Note....",
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Signup = (props) => {
});
// Parsing the Json
const json = await response.json();
console.log(json);

if(json.success) {
localStorage.setItem("token", json.authToken);
// console.log(json.success);
Expand Down
14 changes: 7 additions & 7 deletions src/context/notes/NoteState.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {showToast} = props;
},
});
const json = await response.json();
console.log(json);

setNotes(json);
// setLoading(false);
};
Expand All @@ -35,7 +35,7 @@ const {showToast} = props;
},
});
const json = await response.json();
console.log(json);

if(json.code === 401) {
showToast.error("Permission Not Granted", {duration: 4000});

Expand Down Expand Up @@ -63,7 +63,7 @@ const {showToast} = props;
body: JSON.stringify({ title, description, tag}),
});
const json = await response.json();
console.log(json);

setNotes(notes.concat(json))

// const note = {
Expand All @@ -89,13 +89,13 @@ const {showToast} = props;
}
});
const json = await response.json();
console.log(json);
console.log("Deleting a Note with id: " + id);


const newNotes = notes.filter((note) => {
return note._id !== id;
});
setNotes(newNotes);
console.log("Note Deleted");

};
// Function for editing a Note
const editNote = async (id, title, description, tag) => {
Expand All @@ -108,7 +108,7 @@ const {showToast} = props;
body: JSON.stringify({ title, description, tag }),
});
const json = await response.json();
console.log(json);

let newNotes = JSON.parse(JSON.stringify(notes));
// Logic for Client-side Editing
for (let index = 0; index < newNotes.length; index++) {
Expand Down
2 changes: 1 addition & 1 deletion src/context/toasts/ToastState.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ToastState = (props) => {

const displayToast = (message) => {
let alert = toast.success(message);
console.log(alert);

return alert;
}

Expand Down