Skip to content
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

Implement Get mentors by category endpoint (Admin) #26 #76

Closed
wants to merge 21 commits into from

Conversation

sathudeva7
Copy link
Contributor

Purpose

The purpose of this PR is to fix #26

Goals

This issue involves implementing an API to get mentors by category. The endpoint should allow Admin to make a GET request to {{baseUrl}}/api/admin/mentors?category={{category}}.

Approach

const mentors: Mentor[] = await mentorRepository .createQueryBuilder('mentor') .innerJoinAndSelect('mentor.category', 'category') .leftJoinAndSelect('mentor.profile', 'profile') .select([ 'mentor.uuid', 'category.category', 'mentor.application', 'profile.contact_email', 'profile.first_name', 'profile.last_name', 'profile.image_url', 'profile.linkedin_url' ]) .where('category.category ILIKE :name', { name: categoryQuery }) .getMany()

Screenshots

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

Test environment

Learning

@sathudeva7
Copy link
Contributor Author

@anjula-sack please review this

Comment on lines 129 to 138
.select([
'mentor.uuid',
'category.category',
'mentor.application',
'profile.contact_email',
'profile.first_name',
'profile.last_name',
'profile.image_url',
'profile.linkedin_url'
])
Copy link
Member

Choose a reason for hiding this comment

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

Without selecting fields, what does it return? @sathudeva7 Also can you drop a comment on the issue and get assigned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry for the mistake could you please assign me to this issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without selecting fields ->

Screenshot 2023-10-24 at 16 27 54

Copy link
Member

Choose a reason for hiding this comment

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

@sathudeva7 Can you drop a comment on the issue then I will assign you

Copy link
Member

Choose a reason for hiding this comment

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

@sathudeva7 Can you update it to without selecting?

Copy link
Member

Choose a reason for hiding this comment

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

Any updates @sathudeva7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will update within this week

Copy link
Member

Choose a reason for hiding this comment

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

Any updates @sathudeva7?

@anjula-sack
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Get mentors by category endpoint (Admin)
2 participants