Skip to content

DRAFT --- Add API Route to Fetch User Profile + Polls (api/user-profile) #45

@tran2106

Description

@tran2106

Create an authenticated route to return a user’s profile info along with polls they’ve created and participated in. If the user is an admin, include that role in the response.

  • Route: GET /api/users/:userId/profile (auth required)

  • Returns user info: firstName, lastName, userName, email, and role (e.g. "user" or "admin")

Includes:

  • createdPolls: polls created by the user

  • participatedPolls: polls viewed or voted on by the user

  • Ensure password and sensitive fields are excluded

  • If the user is an admin, include "role": "admin" in the JSON response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    NOT MVP

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions