sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
10 stars 37 forks source link

Implement Get all mentor emails endpoint (Admin) #43 #71

Closed sathudeva7 closed 11 months ago

sathudeva7 commented 11 months ago

Purpose

The purpose of this PR is to fix #43

Goals

This issue involves implementing an API to Get all mentor emails. The endpoint should allow Admin to make a GET request to {{baseUrl}}/api/admin/mentor/emails?status=ACCEPTED.

Approach

     const allMentors: Mentor[] = await mentorRepository.find({
      where: status ? { state: status } : {},
      select: ['profile'],
      relations: ['profile', 'category']
    })

    const emails = allMentors.map((mentor) => mentor?.profile?.primary_email)

Screenshots

Checklist

Related PRs

## Test environment ## Learning