Skip to content

Fix Issue#1120

Merged
davedumto merged 1 commit into
StreamFi-x:devfrom
JSE19:FixIssue1102
Jun 29, 2026
Merged

Fix Issue#1120
davedumto merged 1 commit into
StreamFi-x:devfrom
JSE19:FixIssue1102

Conversation

@JSE19

@JSE19 JSE19 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1102

Changes proposed
What were you told to do?
feat(routes-f): Q&A question queue — Viewers submit questions during a stream and the streamer reads them in order.
What did you do?
Created app/api/routes-f/questions/ with:

  • types.ts — TypeScript interfaces for Question, submit/answer/upvote request/response shapes
  • store.ts — In-memory store with addQuestion, getPendingQuestions (sorted by queued_at), markAsAnswered, upvoteQuestion (dedup per viewer), and resetStore for test isolation
  • route.ts — GET ?stream_id returns pending queue; POST { stream_id, viewer_id, question } submits a question and returns { question_id, queued_at }
  • [id]/answer/route.ts — POST { creator_id } marks the question as answered (404 if missing, 409 if already answered)
  • [id]/upvote/route.ts — POST { viewer_id } increments score with dedup (409 on duplicate upvote)
  • tests/route.test.ts — 14 tests covering submit, list, answer, upvote flows and all error paths
    No files outside app/api/routes-f/ were touched.
    Check List
  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@JSE19 is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davedumto davedumto merged commit 96b712a into StreamFi-x:dev Jun 29, 2026
4 of 6 checks passed
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.

feat(routes-f): Q&A question queue

2 participants