Fix event creation with empty user group validation and default value #274
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.
This PR fixes a critical issue where events could be created without a valid user group, resulting in inaccessible events with
userGroupId=0.Problem
The event registration form had two issues:
0byz.coerce.number(), which passed validation but created invalid events that no one could accessSolution
1. Enhanced Validation
Updated the Zod schema in
viewmodel.tsto ensureuserGroupIdis a positive integer:2. Default Value Selection
Modified
EventRegisterTemplate.tsxto automatically select the first available user group:Results
0values now fail validation with proper error message: "ユーザーグループの指定が不正です。"userGroupId=0The screenshot shows the validation error message being properly displayed when attempting to create an event with an invalid user group.
Fixes #272.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.comnode /home/REDACTED/work/for-moku/for-moku/front/node_modules/.bin/next build(dns block)next-server (v15.3.2)(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.