Skip to content

Fix issue1110#1115

Merged
davedumto merged 3 commits into
StreamFi-x:devfrom
JSE19:FixIssue1110
Jun 29, 2026
Merged

Fix issue1110#1115
davedumto merged 3 commits into
StreamFi-x:devfrom
JSE19:FixIssue1110

Conversation

@JSE19

@JSE19 JSE19 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #1110

Changes proposed

What were you told to do?

feat(routes-f): channel language preference

Manage channel primary stream language and secondary supported languages.

Requirements:

  • GET ?creator_id returns { primary, secondary: string[] }
  • PUT to update with BCP 47 codes
  • Validate codes against bundled supported list
  • Cap secondary at 4
  • Tests cover validation and cap

What did you do?

Created a self-contained language preference route at app/api/routes-f/language/:

  • route.ts — Two handlers:
    • GET — Returns { primary, secondary } for a creator (empty strings if never set)
    • PUT — Accepts { creator_id, primary, secondary }, validates all codes against the bundled list, caps secondary at 4 (zod .max(4)), rejects duplicate secondary codes
  • _lib/languages.ts — Bundled list of 40 common BCP 47 codes (en, es, fr, de, ja, ko, zh, ar, hi, etc.), shared in-memory store, isValidCode() helper
  • __tests__/route.test.ts — Tests covering: empty response for unknown creator, store and retrieve, unsupported primary code rejected, unsupported secondary code rejected, >4 secondary rejected, duplicate secondary rejected, overwrite previous preferences

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.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@JSE19 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@davedumto davedumto merged commit c350f8e 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): channel language preference

2 participants