From 6cd3fc48fbd445c03795ed9f8685905732f19f3e Mon Sep 17 00:00:00 2001 From: Devesh Shukla Date: Mon, 26 Aug 2024 23:40:24 +0530 Subject: [PATCH] smallbugs --- backend/src/controller/search.js | 12 ++++++------ frontend/src/components/Search.jsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/controller/search.js b/backend/src/controller/search.js index 3343408..c84dd1d 100644 --- a/backend/src/controller/search.js +++ b/backend/src/controller/search.js @@ -5,7 +5,7 @@ import axios from "axios"; export const getUsers = async (req, res) => { try { const { key } = req.query; - console.log(req.query); + // console.log(req.query); let limit = 3; let users = await prisma.user.findMany({ @@ -46,7 +46,7 @@ export const getUsers = async (req, res) => { export const getUser = async (req, res) => { try { const { key } = req.query; - console.log(req.query); + // console.log(req.query); let user = await prisma.user.findUnique({ where: { @@ -71,7 +71,7 @@ export const getUser = async (req, res) => { }, }, }); - console.log(user); + // console.log(user); res.status(200).send(user); } catch (error) {} @@ -81,7 +81,7 @@ export const getUserPosts = async (req, res) => { const page = parseInt(req.query.page) || 1; const limit = parseInt(req.query.limit) || 10; const offset = parseInt(req.query.offset) || (page - 1) * limit; - console.log(page, offset); + // console.log(page, offset); const { userID, username } = req.query; try { @@ -120,7 +120,7 @@ export const getUserComments = async (req, res) => { const page = parseInt(req.query.page) || 1; const limit = parseInt(req.query.limit) || 10; const offset = parseInt(req.query.offset) || (page - 1) * limit; - console.log(page, offset); + // console.log(page, offset); const { userID, username } = req.query; try { @@ -207,7 +207,7 @@ export const getLCdata = async (req, res) => { process.env.LC_SECRETKEY ); const username = bytes.toString(CryptoJS.enc.Utf8); - console.log("LC_username", username); + // console.log("LC_username", username); const data =await getLeetCodeData(username); diff --git a/frontend/src/components/Search.jsx b/frontend/src/components/Search.jsx index 64e2e38..b107f65 100644 --- a/frontend/src/components/Search.jsx +++ b/frontend/src/components/Search.jsx @@ -108,7 +108,7 @@ export const fetchUsers = async ({ debouncedSearch, setUsers, setRooms, setLoadi setUsers(res.data.users) - setRooms(res.data.rooms) + if(setRooms)setRooms(res.data.rooms) } catch (error) { console.error('Error fetching users:', error); }