Submissions: shared client+server validation + brand-voice states#10
Open
VisionaireLabs wants to merge 1 commit into
Open
Submissions: shared client+server validation + brand-voice states#10VisionaireLabs wants to merge 1 commit into
VisionaireLabs wants to merge 1 commit into
Conversation
Add lib/submission.ts as the single source of truth for submission validation, imported by both the submit form and the /api/submit route so rules can't drift. Validates email/URL shape, version, lengths, platform/category membership, and free-vs-paid price rules. - Client: runs the same validator before POST, shows inline per-field errors and hydrates field errors returned by the server. - Server: validates authoritatively, returns field-keyed errors, and stops leaking raw DB error messages to clients. - Error/success copy rewritten in the Solid State voice. Insert row shape verified against migration 0001 (submissions) columns and the "Anyone can submit" RLS insert policy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes SOL-6.
What
Adds matched client- and server-side validation to the skill submission flow, with success/error states in the Solid State voice.
lib/submission.ts— single source of truth for validation, imported by both the form and the API route so the rules can't drift. Checks email/URL shape, version format, field lengths (short_description capped at 120 to match the DB constraint), category/platform membership, and free-vs-paid price rules ($1–$999, required when paid, forbidden when free).SubmitForm.tsx) — runs the same validator before the POST for instant feedback, renders inline per-field errors, and hydrates field errors the server returns./api/submit) — validates authoritatively (never trusts the client), returns field-keyed errors, and no longer leaks raw Supabase error strings to the browser.Pipeline verification
tsc --noEmitandeslintboth pass on the changed files.migration 0001(submissionstable) and the"Anyone can submit"RLS insert policy — the route writes exactly the insertable columns,statusdefaults topending.NEXT_PUBLIC_SUPABASE_*(andRESEND_API_KEYfor the email) which aren't available in the agent sandbox; the pipeline is verified by schema/contract review, not a live insert.🤖 Generated with Claude Code