feat(projects): make assigned staff optional - #392
Merged
Conversation
Admins reach every project through `users.is_admin`, not through a membership row, so a project with an empty roster is still fully reachable by the people who administer it. The "select at least 1 staff member" rule was the only thing forcing a roster at creation time — the API already accepted an empty `members` array and the schema never required one — so it is dropped along with the `*` on the field. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Assigned staff is no longer required when creating (or editing) a project.
Why
Admins are members of every project implicitly:
@branch/rbacgrants them every project action offusers.is_admin, never off aproject_membershipsrow. A project that saves with an empty roster is therefore still fully reachable by the people who administer it, and forcing a roster at creation time just blocks setting a project up before staffing is decided.Changes
ProjectFormModal— drop themembers.length === 0validation rule, therequiredasterisk on the Assigned Staff field, and the now-unreachable error wiring onStaffPicker.projectslambda — refresh thecreateProjecttransaction comment, which cited the form rule that no longer exists.members: [].No backend or schema change was needed:
validateMembersalready accepted an omitted/empty array,createProjectdefaults it to[]and only demandsproject:manageMemberswhen the roster is non-empty, and no column or constraint required a membership.Testing
Not run in this session, per request — CI (
frontend-ci,lambda-tests) is the check.🤖 Generated with Claude Code