From 4e3c9f4106c4108425cb63b51d2304485628c486 Mon Sep 17 00:00:00 2001 From: Andrew Qian Date: Thu, 31 Oct 2024 10:59:51 -0400 Subject: [PATCH] cleaning up console.log statements --- client/src/auth/auth_utils.ts | 5 ++--- client/src/modules/Course/Components/ReviewModal.tsx | 3 --- client/src/modules/Results/Components/PreviewCard.jsx | 9 --------- client/src/modules/Results/Components/ResultsDisplay.jsx | 2 +- server/src/admin/admin.router.ts | 1 - 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/client/src/auth/auth_utils.ts b/client/src/auth/auth_utils.ts index 9234fc4c..18def883 100644 --- a/client/src/auth/auth_utils.ts +++ b/client/src/auth/auth_utils.ts @@ -12,7 +12,6 @@ import axios from 'axios' export const setAuthToken = (token: string) => { Session.setPersistent({ token: token }) if (Session.get('token') !== token) { - console.log('Error saving token to session') return false } return true @@ -86,7 +85,7 @@ export function useAuthMandatoryLogin(redirectFrom: string): { } } - getEmail().catch((e) => console.log("[ERROR] Failed in authMandatoryLogin: ", e.response)) + getEmail().catch((e) => e) setToken(authToken) setIsAuthenticating(false) setIsLoggedIn(true) @@ -138,7 +137,7 @@ export function useAuthOptionalLogin(): { setToken(authToken) setIsLoggedIn(true) } - getEmail().catch(e => console.log('[ERROR] Get Email in useAuthOptionalLogin(): ', e)); + getEmail().catch(e => e); }, []) diff --git a/client/src/modules/Course/Components/ReviewModal.tsx b/client/src/modules/Course/Components/ReviewModal.tsx index bbbf69ab..c90dbe04 100644 --- a/client/src/modules/Course/Components/ReviewModal.tsx +++ b/client/src/modules/Course/Components/ReviewModal.tsx @@ -102,7 +102,6 @@ const ReviewModal = ({ } function handleSubmitReview() { - console.log('tried to submit') if (validReview()) { const newReview: NewReview = { rating: overall, @@ -115,8 +114,6 @@ const ReviewModal = ({ major: selectedMajors, } submitReview(newReview) - - console.log('Submitting') } else return } diff --git a/client/src/modules/Results/Components/PreviewCard.jsx b/client/src/modules/Results/Components/PreviewCard.jsx index 3399e443..7be78997 100644 --- a/client/src/modules/Results/Components/PreviewCard.jsx +++ b/client/src/modules/Results/Components/PreviewCard.jsx @@ -88,16 +88,7 @@ export default class PreviewCard extends Component { topReview: {}, numReviews: 0, }) - // eslint-disable-next-line no-console - console.log( - `No professor reviews for course by id = ${this.props.course._id}}` - ) } - } else { - // eslint-disable-next-line no-console - console.log( - `Unable to find reviews by course by id = ${this.props.course._id}` - ) } }) } diff --git a/client/src/modules/Results/Components/ResultsDisplay.jsx b/client/src/modules/Results/Components/ResultsDisplay.jsx index 7adb94b0..663a71e3 100644 --- a/client/src/modules/Results/Components/ResultsDisplay.jsx +++ b/client/src/modules/Results/Components/ResultsDisplay.jsx @@ -285,7 +285,7 @@ export default class ResultsDisplay extends Component { } getSubjectOptions(inputValue, callback) { - console.log('Deprecated functionality') + console.log() } setShowFilterPopup() { diff --git a/server/src/admin/admin.router.ts b/server/src/admin/admin.router.ts index 9b43b457..3c9296e5 100644 --- a/server/src/admin/admin.router.ts +++ b/server/src/admin/admin.router.ts @@ -199,7 +199,6 @@ adminRouter.post('/reviews/get-pending', async (req, res) => { try { const { token }: AdminRequestType = req.body; const auth = new Auth({ token }); - console.log(auth) const reviews = await getPendingReviews({ auth }); if (reviews === null) { return res.status(400).json({