Skip to content

Display Pushlised Poll for Host and Invited Users Through Links (api/poll-view-backend) #46

@tran2106

Description

@tran2106

Track when an authenticated user accesses a poll (via /poll/:slug) so the poll can appear in their dashboard even if they don’t vote.

  • Create POST /api/polls/:slug/track route

  • Authenticate the user (req.user.id)

  • Find poll by slug

  • If the user is the poll creator or participant:

  • Add poll to user’s accessed/seen list (e.g. via UserPolls, PollViews, or PollAccesses table)

  • Only log access once (skip if already tracked)

  • Return success (200 or 204)

Metadata

Metadata

Assignees

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions