Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(key === 'participantsCount' | ||
| ? { | ||
| participants: buildParticipants(value as number).map((participant, index) => ({ | ||
| ...participant, | ||
| ...prev.participants[index], |
There was a problem hiding this comment.
Expanding participant count throws TypeError
Increasing the participant count calls updateField('participantsCount', …), which recreates the array by spreading prev.participants[index] into each new slot. For indexes that did not exist previously this value is undefined, and object spread on undefined raises Cannot convert undefined or null to object. The first attempt to add a second participant will therefore crash the form and prevent multi-person bookings.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_b_690262c104748328802778a89b5955ec