Skip to content

Conversation

@obaidsafi51
Copy link
Collaborator

Find Mentor feature has been revised

@@ -1,3 +1,4 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is extra empty line, can you please remove this.

)
.where(eq(userContactsTable.user_id, currentUserId))
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line, can you please remove this.

})
console.log(`✅ Assigned mentor role to ${mentorInfo.user.first_name}`)
} catch (error) {
// Role assignment might already exist - ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra comments from all your code only. Only keep the relevant comments please.

import { GetAllMentors, GetMentorById } from "@/src/db/data-access/user/query"
import { GetMentorRatings, GetMentorRelationships } from "@/src/db/data-access/mentor/query"
import { db } from "@/src/db"

Copy link
Collaborator

@AbdulRehmanGHub AbdulRehmanGHub Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some extra empty lines and extra comments in this file, can you remove the extra empty lines and comments please.


export type SelectShortcut = typeof shortcutsTable.$inferSelect
export type InsertShortcut = typeof shortcutsTable.$inferInsert

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty lines - keep only 1 empty line for clean code - remove extra empty lines please in all places where required.

Comment on lines 194 to 197
console.log('[FindMentor] mentorsResult:', mentorsResult);
if (mentorsResult.success && mentorsResult.data) {
console.log('[FindMentor] mentors data:', mentorsResult.data);
mentorsResult.data.forEach((m) => console.log(`Mentor: ${m.name}`, 'Skills:', m.skills, 'Interests:', m.interests));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra console logs needs to be removed.

mentorId: string
message?: string
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some extra empty lines and extra comments in this file, can you remove the extra empty lines and comments please.

import { db } from ".."
import { usersTable, profileTable, tagsTable, userTagsTable, userRolesTable, rolesTable, mentorRatingsTable, mentorRelationshipsTable } from "../schema"

const mentorData = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this data is using anywhere, then it's good. If not then remove all the extra or dummy data please.

{/* Search and Sort */}
<div className="flex flex-col sm:flex-row items-center gap-2 mb-3">
<div className="relative w-full sm:flex-1">
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-muted-foreground" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please normal or little small the text size of search and placeholder for better view. Placeholder text is lengthy and not showing properly.

Comment on lines 58 to 60
const roleName = userRole.role?.name?.toLowerCase()
const roleSlug = (userRole.role as any).slug?.toLowerCase()
return roleName === "mentor" || roleSlug === "mentor"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeError: Cannot read properties of null (reading 'slug')

  • The backend is looping through user roles to check if a user is a mentor.
  • For at least one user, userRole.role is null or undefined.
  • The code tries to access .slug on null, causing the error.

}
}

if (available) {
Copy link
Collaborator

@AbdulRehmanGHub AbdulRehmanGHub Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra Work - Upon clicking on the Connect button of mentor Card, it shows the prompt for some message. Not mentioned in the Ticket. I think a simple JS prompt will not be allowed in the project. So, if you could make it a dialog prompt box it would be better for the UI.

@usama-tariq1 usama-tariq1 added the invalid This doesn't seem right label Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants