fix: creating a board without a description returns 500 - #4469
fix: creating a board without a description returns 500#4469brantsrasmus wants to merge 1 commit into
Conversation
`description` is optional in the request schema, but the column is
NOT NULL with no default, so an omitted description reached Prisma as
undefined and the create threw a validation error instead of saving:
Invalid `prisma.board.create()` invocation
Argument `description` is missing.
Default it to an empty string, matching what the UI sends today, and
cover it with an API test.
|
@brantsrasmus is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Greptile SummaryThe PR prevents board creation from failing when API clients omit the optional description.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The fallback applies only when description is omitted, preserves valid supplied strings, matches existing UI behavior, and is covered by an API regression test.
|
| Filename | Overview |
|---|---|
| src/app/api/boards/route.ts | Correctly aligns the optional request field with the required database column by defaulting only omitted descriptions. |
| tests/e2e/api-board.spec.ts | Adds discoverable Playwright coverage that verifies the successful response and persisted empty description. |
Reviews (1): Last reviewed commit: "fix: creating a board without a descript..." | Re-trigger Greptile
Problem
POST /api/boardsreturns 500 whendescriptionis omitted. The request schema marks it.optional(), butboard.descriptionisVARCHAR(500) NOT NULLwith no default, so it reaches Prisma asundefined:The UI always sends a description, so this only bites API clients — I hit it writing an API test.
Fix
Default it to an empty string in the create route, matching what the UI sends today. No schema change, no migration.
Test
tests/e2e/api-board.spec.tscreates a board with{ name, type }only and asserts 200 plusdescription: ''. Verified it fails (500) without the one-line change and passes with it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.