fix: event creation and update property name mismatch#161
Conversation
This change aligns the frontend request payload with the backend API by switching from snake_case (event_date, event_time) to camelCase (eventDate, eventTime). This fixes the validation error that prevented event creation and updates.
|
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 (3)
📝 WalkthroughWalkthroughThis PR updates field naming conventions in the event management flow from snake_case to camelCase. Changes affect the type definitions ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Pull request overview
Fixes event create/update failures caused by a request payload naming mismatch between the frontend and the events API.
Changes:
- Updated
EventFormRequest(and derivedCreateEventRequest/UpdateEventRequest) to useeventDate/eventTime. - Updated event create and edit clients to send
eventDate/eventTimein JSON payloads.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/types/api.ts | Aligns event form request types to the API’s expected camelCase fields (eventDate, eventTime). |
| src/app/events/create/EventCreateClient.tsx | Sends camelCase event date/time fields in the create-event POST payload. |
| src/app/events/[id]/edit/EditEventClient.tsx | Sends camelCase event date/time fields in the update-event PATCH payload. |
|
I need this quickly, merging…. |
This PR fixes issue #160 where event creation and updates were failing due to a mismatch between frontend property names and backend API expectations.
Changes:
event_date,event_time) to camelCase (eventDate,eventTime) inEventFormRequesttypes and frontend request payloads.src/app/api/events/route.tsandsrc/app/api/events/[id]/route.ts).Closes #160
Summary by CodeRabbit