fix: allow clearing event description via PATCH#149
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe API PATCH handler now conditionally includes Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant API as Server (PATCH /events/:id)
participant DB as Database
Client->>API: PATCH /events/:id\n{ title, ..., description? }
API->>API: Build updateData\ninclude description only if key present
API->>DB: UPDATE events SET ...,\ndescription = CASE WHEN $hasDescription THEN $valueOrNull ELSE description END
DB-->>API: OK / updated row
API-->>Client: 200 OK / updated event
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/db.ts`:
- Around line 624-635: Rename the boolean variable descriptionProvided to use
the required boolean prefix (e.g., isDescriptionProvided) and update all its
usages in the SQL update logic accordingly; specifically change the variable
declaration currently using descriptionProvided (which checks data.description
!== undefined) to isDescriptionProvided and replace the reference inside the
CASE expression (WHEN ${descriptionProvided} THEN ...) so the name matches
everywhere (also update any other references in this module that rely on
descriptionProvided).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7554ce1a-56f5-4fdf-93c6-36ccd3a3e387
📒 Files selected for processing (2)
src/app/api/events/[id]/route.tssrc/lib/db.ts
Description
Created a feature that allows clearing event details.
Type of Change
Changes Made
Testing
npm run devnpm run build)npm run lint)Screenshots (if applicable)
Checklist
Related Issues
Summary by CodeRabbit