From 927a9aa2abb0e11b8c458812bec0d6a1962f7199 Mon Sep 17 00:00:00 2001 From: YosephSE <88291669+YosephSE@users.noreply.github.com> Date: Wed, 18 Sep 2024 00:24:54 +0300 Subject: [PATCH 1/2] all console.logs removed --- client/components/admin/JobsTable.tsx | 1 - client/redux/slices/AdminSlice.tsx | 1 - client/utils/imageUploader.ts | 2 -- server/src/controllers/applications.controller.ts | 1 - server/src/utils/applicationScore.ts | 1 - 5 files changed, 6 deletions(-) diff --git a/client/components/admin/JobsTable.tsx b/client/components/admin/JobsTable.tsx index b005609..d61cf70 100644 --- a/client/components/admin/JobsTable.tsx +++ b/client/components/admin/JobsTable.tsx @@ -32,7 +32,6 @@ export default function DataTable() { fetchJobs(); }, [dispatch]); - console.log(allJobs) useEffect(() => { if (allJobs) { setLocalJobs( diff --git a/client/redux/slices/AdminSlice.tsx b/client/redux/slices/AdminSlice.tsx index 03e9802..242b99b 100644 --- a/client/redux/slices/AdminSlice.tsx +++ b/client/redux/slices/AdminSlice.tsx @@ -116,7 +116,6 @@ export const approve = createAsyncThunk( async(id: string, { rejectWithValue }) => { try{ const response = await axios.post(`${api}/admins/approve/${id}`) - console.log(response.data) return response.data } catch(error: any) { return rejectWithValue(error.response?.data?.error || error.response.data.message) diff --git a/client/utils/imageUploader.ts b/client/utils/imageUploader.ts index 1de1007..99e3bc7 100644 --- a/client/utils/imageUploader.ts +++ b/client/utils/imageUploader.ts @@ -11,8 +11,6 @@ const uploadImage = async (file: any) => { const storageRef = ref(storage, `images/${uniqueName}`); const snapshot = await uploadBytes(storageRef, file); const image = await getDownloadURL(snapshot.ref); - console.log("Image uploaded successfully"); - console.log(image); return image; }; diff --git a/server/src/controllers/applications.controller.ts b/server/src/controllers/applications.controller.ts index e32c94f..f6e80b2 100644 --- a/server/src/controllers/applications.controller.ts +++ b/server/src/controllers/applications.controller.ts @@ -59,7 +59,6 @@ const createApplication = asyncHandler( job: jobDetails, candidate: candidateDetails, }; - console.log(toBeScored); const score = await applicationScore(toBeScored); const newApplication = { diff --git a/server/src/utils/applicationScore.ts b/server/src/utils/applicationScore.ts index 7c00ea4..671518e 100644 --- a/server/src/utils/applicationScore.ts +++ b/server/src/utils/applicationScore.ts @@ -4,7 +4,6 @@ const applicationScore = async (application: any): Promise => { require("dotenv").config(); const genAI = new GoogleGenerativeAI(process.env.API_KEY!); const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" }); - console.log(application); const prompt = `Please score the candidate's application out of 100 using your own criteria. Candidate Information: ${application.candidate} Job Criteria: ${application.job} Score the application based on the information provided above. Respond with only a number indicating the score. the format should be xx. For example, if you think the application deserves a score of 80, respond with 80.`; const result = await model.generateContent(prompt); From eeff60d1e9087948320d0ed126be2177d258443d Mon Sep 17 00:00:00 2001 From: YosephSE <88291669+YosephSE@users.noreply.github.com> Date: Wed, 18 Sep 2024 00:28:30 +0300 Subject: [PATCH 2/2] AI scoring fallback updated --- server/src/utils/applicationScore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/utils/applicationScore.ts b/server/src/utils/applicationScore.ts index 671518e..35c510b 100644 --- a/server/src/utils/applicationScore.ts +++ b/server/src/utils/applicationScore.ts @@ -12,7 +12,7 @@ const applicationScore = async (application: any): Promise => { return Number.isNaN(score) ? 0 : score; } catch (error) { console.error(error); - return Math.floor(Math.random() * 100); + return 0; } };