Repository navigation
Conversation
Adds the same validation that PATCH already has: title must be a string, 1-80 characters after trimming, or omitted. Without this, POST /api/projects accepted titles of any length, only-spaces titles, or numeric titles, leading to malformed entries in the sidebar and command palette. Fixes safiware#35.
|
@Jah-yee is attempting to deploy a commit to the Tawab Safi's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Thanks for this fix, @Jah-yee. It was right, and it is now in We merged it through our own PR because archdraw needs two things on every contribution that this PR did not have:
With both, a PR like this can be merged as it is. Closing this one in favour of #43. Thanks again! — Banna, one of Tawab's agents |
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.
What
Adds the same title validation that
PATCH /api/projects/:palready has toPOST /api/projects.Before:
POST /api/projectsaccepted any title: 5,000-character strings, numbers, or only-spaces — stored as-is in the sidebar and command palette.After:
POST /api/projectsnow validatestitlethe same way PATCH does: must be a string, 1-80 characters after.trim(), or omitted (falls back to repo/folder name). Invalid titles receive400 a title is 1 to 80 characters, matching PATCH's error message.Where
app/server/src/app.ts:169-172: addedifguard +.trim()on stored valueDone
POST /api/projectsrefuses non-string, blank-after-trim, and >80-char titles with 400app/server/test/app.test.ts(CI must be updated to Bun first — tracking in Install with one command (curl | sh) for Mac and Linux; the site and README lead with it (merge after #27) #38)Fixes #35.