Skip to content

Commit

Permalink
smallbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
imdeveshshukla committed Aug 26, 2024
1 parent 05253f1 commit 6cd3fc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions backend/src/controller/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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: {
Expand All @@ -71,7 +71,7 @@ export const getUser = async (req, res) => {
},
},
});
console.log(user);
// console.log(user);

res.status(200).send(user);
} catch (error) {}
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6cd3fc4

Please sign in to comment.