-
Notifications
You must be signed in to change notification settings - Fork 4
SPARK-70 Find mentor feature revised #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
src/middleware.ts
Outdated
| @@ -1,3 +1,4 @@ | |||
|
|
|||
There was a problem hiding this comment.
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)) | ||
| } | ||
|
|
There was a problem hiding this comment.
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.
src/db/seeds/MentorSeed.ts
Outdated
| }) | ||
| console.log(`✅ Assigned mentor role to ${mentorInfo.user.first_name}`) | ||
| } catch (error) { | ||
| // Role assignment might already exist - ignore |
There was a problem hiding this comment.
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" | ||
|
|
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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.
| 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)); |
There was a problem hiding this comment.
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 | ||
| } | ||
|
|
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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.
| const roleName = userRole.role?.name?.toLowerCase() | ||
| const roleSlug = (userRole.role as any).slug?.toLowerCase() | ||
| return roleName === "mentor" || roleSlug === "mentor" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
Find Mentor feature has been revised