Skip to content

Get connected user's info by participant#70

Merged
rxmox merged 2 commits intobackendfrom
get-connected-user's-info-by-participantId
Mar 7, 2026
Merged

Get connected user's info by participant#70
rxmox merged 2 commits intobackendfrom
get-connected-user's-info-by-participantId

Conversation

@lnqminh3003
Copy link
Collaborator

@lnqminh3003 lnqminh3003 commented Mar 5, 2026

Summary

  • Add GET /api/participantConnections/connected-users endpoint to fetch user profile info for all participants connected with a given participant in an event
  • Returns user profile data (name, email, linkedinUrl, bio, profilePhoto, socialLinks), participant info, and connection description for each connection
  • Returns all connections including multiple connections to the same user with different descriptions (no dedup)
  • Uses Mongoose .populate() to resolve user data in a single query instead of separate lookups
  • Returns 200 with empty array when no connections exist (not 404)
  • Handles null userId gracefully (guest participants) — returns user: null with participant info still included
  • Restores userId: Schema.Types.ObjectId | null on IParticipant interface to match the Mongoose schema's default: null
  • Updates API_REFERENCE.md with full endpoint documentation

Endpoint

GET /api/participantConnections/connected-users?eventId=<id>&participantId=<id>
Authorization: Bearer <token>

Response (200):

[
  {
    "user": { "_id": "...", "name": "...", "email": "...", ... },
    "participantId": "...",
    "participantName": "...",
    "connectionDescription": "Both love hiking"
  }
]

@lnqminh3003 lnqminh3003 changed the base branch from main to backend March 5, 2026 01:26
@lnqminh3003 lnqminh3003 requested a review from rxmox March 5, 2026 01:27
Simplify route path to /connected-users, return 200 with empty array
instead of 404 when no connections exist, remove dedup to preserve all
connections with different descriptions, use populate to reduce DB
queries, handle null userId gracefully, and restore nullable userId
type on Participant interface.
@rxmox rxmox merged commit 03bb315 into backend Mar 7, 2026
1 check passed
@rxmox rxmox deleted the get-connected-user's-info-by-participantId branch March 7, 2026 04:36
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.

2 participants